Skip to content

clk: switch to simple i2c probe function

Stephen Kitt linux-clk lkml 2 versions – Applied

Status from this message: Applied to clk-next

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 21 repliesApplied
  2. v11 patch 2 repliesSuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/10clk: cdce706: use simple i2c probe functiondrivers/clk/clk-cdce706.c+2 -32 replies
2/10clk: cdce925: use i2c_match_id and simple i2c probedrivers/clk/clk-cdce925.c+12 -122 replies
3/10clk: cs2000-cp: use simple i2c probe functiondrivers/clk/clk-cs2000-cp.c+2 -32 replies
4/10clk: max9485: use simple i2c probe functiondrivers/clk/clk-max9485.c+2 -32 replies
5/10clk: si514: use simple i2c probe functiondrivers/clk/clk-si514.c+2 -32 replies
6/10clk: si5341: use simple i2c probe functiondrivers/clk/clk-si5341.c+2 -32 replies
7/10clk: si5351: use i2c_match_id and simple i2c probedrivers/clk/clk-si5351.c+12 -122 replies
8/10clk: si544: use i2c_match_id and simple i2c probedrivers/clk/clk-si544.c+11 -112 replies
9/10clk: si570: use i2c_match_id and simple i2c probedrivers/clk/clk-si570.c+12 -122 replies
10/10clk: renesas-pcie: use simple i2c probe functiondrivers/clk/clk-renesas-pcie.c+2 -23 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchWolfram Sang
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] clk: switch to simple i2c probe function

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(-)
Signature · 1 line
2.27.0