mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Kitt <steve@sk2.org>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wolfram Sang <wsa@kernel.org>, Stephen Kitt <steve@sk2.org>
Subject: [PATCH v2 00/10] clk: switch to simple i2c probe function
Date: Thu,  7 Apr 2022 17:18:21 +0200	[thread overview]
Message-ID: <20220407151831.2371706-1-steve@sk2.org> (raw)

This series of patches updates i2c probes in clk to use the simple
probe variant (simple as in "single argument"), probe_new, following
one of two scenarios.

In the first scenario, the existing probe function

int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);

(see struct i2c_driver in include/linux/i2c.h) doesn't use the id
argument, so it can be trivially converted to

int (*probe_new)(struct i2c_client *client);

and the i2c_driver declaration updated to use .probe_new instead of
.probe.

In the second scenario, the probe function does use the id argument.
In this case, the relevant part of the calling code,

        /*
         * When there are no more users of probe(),
         * rename probe_new to probe.
         */
        if (driver->probe_new)
                status = driver->probe_new(client);
        else if (driver->probe)
                status = driver->probe(client,
                                       i2c_match_id(driver->id_table, client));
        else
                status = -EINVAL;

(from drivers/i2c/i2c-core-base.c) is moved down into the probe
function, typically along the lines of

const struct i2c_device_id *id = i2c_match_id(ids, id);

where ids is the i2c_device_id table. The latter needs to be declared
before the probe function; as suggested by Wolfram Sang, the full
definition is moved above the probe function.

Changes since v1:
  - the pair of patches have been split up into a single patch series
    with one patch per modified file, and the commit titles adjusted
    accordingly
  - renesas-pcie has been added


Stephen Kitt (10):
  clk: cdce706: use simple i2c probe function
  clk: cdce925: use i2c_match_id and simple i2c probe
  clk: cs2000-cp: use simple i2c probe function
  clk: max9485: use simple i2c probe function
  clk: si514: use simple i2c probe function
  clk: si5341: use simple i2c probe function
  clk: si5351: use i2c_match_id and simple i2c probe
  clk: si544: use i2c_match_id and simple i2c probe
  clk: si570: use i2c_match_id and simple i2c probe
  clk: renesas-pcie: use simple i2c probe function

 drivers/clk/clk-cdce706.c      |  5 ++---
 drivers/clk/clk-cdce925.c      | 24 ++++++++++++------------
 drivers/clk/clk-cs2000-cp.c    |  5 ++---
 drivers/clk/clk-max9485.c      |  5 ++---
 drivers/clk/clk-renesas-pcie.c |  4 ++--
 drivers/clk/clk-si514.c        |  5 ++---
 drivers/clk/clk-si5341.c       |  5 ++---
 drivers/clk/clk-si5351.c       | 24 ++++++++++++------------
 drivers/clk/clk-si544.c        | 22 +++++++++++-----------
 drivers/clk/clk-si570.c        | 24 ++++++++++++------------
 10 files changed, 59 insertions(+), 64 deletions(-)

-- 
2.27.0


             reply	other threads:[~2022-04-07 15:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 15:18 Stephen Kitt [this message]
2022-04-07 15:18 ` [PATCH v2 01/10] clk: cdce706: use " Stephen Kitt
2022-04-07 20:09   ` Wolfram Sang
2022-04-07 20:15   ` Wolfram Sang
2022-04-23  2:32   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 02/10] clk: cdce925: use i2c_match_id and simple i2c probe Stephen Kitt
2022-04-07 20:13   ` Wolfram Sang
2022-04-23  2:32   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 03/10] clk: cs2000-cp: use simple i2c probe function Stephen Kitt
2022-04-07 20:14   ` Wolfram Sang
2022-04-23  2:32   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 04/10] clk: max9485: " Stephen Kitt
2022-04-07 20:14   ` Wolfram Sang
2022-04-23  2:33   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 05/10] clk: si514: " Stephen Kitt
2022-04-07 20:14   ` Wolfram Sang
2022-04-23  2:33   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 06/10] clk: si5341: " Stephen Kitt
2022-04-07 20:14   ` Wolfram Sang
2022-04-23  2:33   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 07/10] clk: si5351: use i2c_match_id and simple i2c probe Stephen Kitt
2022-04-07 20:18   ` Wolfram Sang
2022-04-23  2:34   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 08/10] clk: si544: " Stephen Kitt
2022-04-07 20:19   ` Wolfram Sang
2022-04-23  2:34   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 09/10] clk: si570: " Stephen Kitt
2022-04-07 20:19   ` Wolfram Sang
2022-04-23  2:35   ` Stephen Boyd
2022-04-07 15:18 ` [PATCH v2 10/10] clk: renesas-pcie: use simple i2c probe function Stephen Kitt
2022-04-07 20:19   ` Wolfram Sang
2022-04-23  2:35   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220407151831.2371706-1-steve@sk2.org \
    --to=steve@sk2.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®