Skip to content

Commit ca3ebd2

Browse files
skittbebarino
authored andcommitted
clk: si5351: use i2c_match_id and simple i2c probe
As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220407151831.2371706-8-steve@sk2.org Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent adc00f6 commit ca3ebd2

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

drivers/clk/clk-si5351.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,9 +1367,18 @@ si53351_of_clk_get(struct of_phandle_args *clkspec, void *data)
13671367
}
13681368
#endif /* CONFIG_OF */
13691369

1370-
static int si5351_i2c_probe(struct i2c_client *client,
1371-
const struct i2c_device_id *id)
1370+
static const struct i2c_device_id si5351_i2c_ids[] = {
1371+
{ "si5351a", SI5351_VARIANT_A },
1372+
{ "si5351a-msop", SI5351_VARIANT_A3 },
1373+
{ "si5351b", SI5351_VARIANT_B },
1374+
{ "si5351c", SI5351_VARIANT_C },
1375+
{ }
1376+
};
1377+
MODULE_DEVICE_TABLE(i2c, si5351_i2c_ids);
1378+
1379+
static int si5351_i2c_probe(struct i2c_client *client)
13721380
{
1381+
const struct i2c_device_id *id = i2c_match_id(si5351_i2c_ids, client);
13731382
enum si5351_variant variant = (enum si5351_variant)id->driver_data;
13741383
struct si5351_platform_data *pdata;
13751384
struct si5351_driver_data *drvdata;
@@ -1649,21 +1658,12 @@ static int si5351_i2c_remove(struct i2c_client *client)
16491658
return 0;
16501659
}
16511660

1652-
static const struct i2c_device_id si5351_i2c_ids[] = {
1653-
{ "si5351a", SI5351_VARIANT_A },
1654-
{ "si5351a-msop", SI5351_VARIANT_A3 },
1655-
{ "si5351b", SI5351_VARIANT_B },
1656-
{ "si5351c", SI5351_VARIANT_C },
1657-
{ }
1658-
};
1659-
MODULE_DEVICE_TABLE(i2c, si5351_i2c_ids);
1660-
16611661
static struct i2c_driver si5351_driver = {
16621662
.driver = {
16631663
.name = "si5351",
16641664
.of_match_table = of_match_ptr(si5351_dt_ids),
16651665
},
1666-
.probe = si5351_i2c_probe,
1666+
.probe_new = si5351_i2c_probe,
16671667
.remove = si5351_i2c_remove,
16681668
.id_table = si5351_i2c_ids,
16691669
};

0 commit comments

Comments
 (0)