Skip to content

Commit 2b349b8

Browse files
skittbebarino
authored andcommitted
clk: si570: 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-10-steve@sk2.org Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 32a5c1d commit 2b349b8

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

drivers/clk/clk-si570.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,20 @@ static const struct regmap_config si570_regmap_config = {
398398
.volatile_reg = si570_regmap_is_volatile,
399399
};
400400

401-
static int si570_probe(struct i2c_client *client,
402-
const struct i2c_device_id *id)
401+
static const struct i2c_device_id si570_id[] = {
402+
{ "si570", si57x },
403+
{ "si571", si57x },
404+
{ "si598", si59x },
405+
{ "si599", si59x },
406+
{ }
407+
};
408+
MODULE_DEVICE_TABLE(i2c, si570_id);
409+
410+
static int si570_probe(struct i2c_client *client)
403411
{
404412
struct clk_si570 *data;
405413
struct clk_init_data init;
414+
const struct i2c_device_id *id = i2c_match_id(si570_id, client);
406415
u32 initial_fout, factory_fout, stability;
407416
bool skip_recall;
408417
int err;
@@ -495,15 +504,6 @@ static int si570_remove(struct i2c_client *client)
495504
return 0;
496505
}
497506

498-
static const struct i2c_device_id si570_id[] = {
499-
{ "si570", si57x },
500-
{ "si571", si57x },
501-
{ "si598", si59x },
502-
{ "si599", si59x },
503-
{ }
504-
};
505-
MODULE_DEVICE_TABLE(i2c, si570_id);
506-
507507
static const struct of_device_id clk_si570_of_match[] = {
508508
{ .compatible = "silabs,si570" },
509509
{ .compatible = "silabs,si571" },
@@ -518,7 +518,7 @@ static struct i2c_driver si570_driver = {
518518
.name = "si570",
519519
.of_match_table = clk_si570_of_match,
520520
},
521-
.probe = si570_probe,
521+
.probe_new = si570_probe,
522522
.remove = si570_remove,
523523
.id_table = si570_id,
524524
};

0 commit comments

Comments
 (0)