Skip to content

Commit 32a5c1d

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

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

drivers/clk/clk-si544.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,19 @@ static const struct regmap_config si544_regmap_config = {
451451
.volatile_reg = si544_regmap_is_volatile,
452452
};
453453

454-
static int si544_probe(struct i2c_client *client,
455-
const struct i2c_device_id *id)
454+
static const struct i2c_device_id si544_id[] = {
455+
{ "si544a", si544a },
456+
{ "si544b", si544b },
457+
{ "si544c", si544c },
458+
{ }
459+
};
460+
MODULE_DEVICE_TABLE(i2c, si544_id);
461+
462+
static int si544_probe(struct i2c_client *client)
456463
{
457464
struct clk_si544 *data;
458465
struct clk_init_data init;
466+
const struct i2c_device_id *id = i2c_match_id(si544_id, client);
459467
int err;
460468

461469
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
@@ -499,14 +507,6 @@ static int si544_probe(struct i2c_client *client,
499507
return 0;
500508
}
501509

502-
static const struct i2c_device_id si544_id[] = {
503-
{ "si544a", si544a },
504-
{ "si544b", si544b },
505-
{ "si544c", si544c },
506-
{ }
507-
};
508-
MODULE_DEVICE_TABLE(i2c, si544_id);
509-
510510
static const struct of_device_id clk_si544_of_match[] = {
511511
{ .compatible = "silabs,si544a" },
512512
{ .compatible = "silabs,si544b" },
@@ -520,7 +520,7 @@ static struct i2c_driver si544_driver = {
520520
.name = "si544",
521521
.of_match_table = clk_si544_of_match,
522522
},
523-
.probe = si544_probe,
523+
.probe_new = si544_probe,
524524
.id_table = si544_id,
525525
};
526526
module_i2c_driver(si544_driver);

0 commit comments

Comments
 (0)