Skip to content

Commit 919a83d

Browse files
bijudasgroeck
authored andcommitted
hwmon: (tmp513) Simplify probe()
Simpilfy probe() by replacing device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230824204456.401580-3-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent d103337 commit 919a83d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/hwmon/tmp513.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,7 @@ static int tmp51x_probe(struct i2c_client *client)
720720
if (!data)
721721
return -ENOMEM;
722722

723-
if (client->dev.of_node)
724-
data->id = (uintptr_t)device_get_match_data(&client->dev);
725-
else
726-
data->id = i2c_match_id(tmp51x_id, client)->driver_data;
723+
data->id = (uintptr_t)i2c_get_match_data(client);
727724

728725
ret = tmp51x_configure(dev, data);
729726
if (ret < 0) {

0 commit comments

Comments
 (0)