aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2023-08-24 21:44:55 +0100
committerGuenter Roeck <linux@roeck-us.net>2023-08-25 07:43:10 -0700
commit919a83d020a8dfa1411c1dc1cff23a833f0f5268 (patch)
tree6ecc1c0e0c1e65eaae15ca01b504c4125c962d88 /drivers/hwmon
parentd103337e38e7e64c3d915029e947b1cb0b512737 (diff)
downloadlinux-919a83d020a8dfa1411c1dc1cff23a833f0f5268.tar.gz
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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/tmp513.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index 8ee6e02b02e3b..9a180b1030c97 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -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) {