Skip to content

Commit

Permalink
hwmon: (tmp513) Simplify probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Biju Das authored and Guenter Roeck committed Aug 25, 2023
1 parent d103337 commit 919a83d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/hwmon/tmp513.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,7 @@ static int tmp51x_probe(struct i2c_client *client)
if (!data)
return -ENOMEM;

if (client->dev.of_node)
data->id = (uintptr_t)device_get_match_data(&client->dev);
else
data->id = i2c_match_id(tmp51x_id, client)->driver_data;
data->id = (uintptr_t)i2c_get_match_data(client);

ret = tmp51x_configure(dev, data);
if (ret < 0) {
Expand Down

0 comments on commit 919a83d

Please sign in to comment.