summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2026-03-06 11:16:48 -0600
committerGuenter Roeck <linux@roeck-us.net>2026-03-30 19:45:06 -0700
commit1ca93dd91b5072301d9f9dada7b2057178d8c738 (patch)
tree9fa57d4954e64e0092b98c4dbee42df8d8431a3b /drivers/hwmon
parent241662082bc554fe9500d1258d70064d4a008905 (diff)
downloadlinux-1ca93dd91b5072301d9f9dada7b2057178d8c738.tar.gz
linux-1ca93dd91b5072301d9f9dada7b2057178d8c738.zip
hwmon: (pmbus/q54sj108a2) Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from the i2c_device_id table. This is often used to then retrieve the matching driver_data. This can be done in one step with the helper i2c_get_match_data(). This helper has another benefit: * It also checks for device match data, which means we do not have to manually check that first. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20260306171652.951274-8-afd@ti.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/pmbus/q54sj108a2.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
index d5d60a9af8c5..7e799f36f923 100644
--- a/drivers/hwmon/pmbus/q54sj108a2.c
+++ b/drivers/hwmon/pmbus/q54sj108a2.c
@@ -292,10 +292,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
I2C_FUNC_SMBUS_BLOCK_DATA))
return -ENODEV;
- if (client->dev.of_node)
- chip_id = (enum chips)(unsigned long)of_device_get_match_data(dev);
- else
- chip_id = i2c_match_id(q54sj108a2_id, client)->driver_data;
+ chip_id = (enum chips)(uintptr_t)i2c_get_match_data(client);
ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID, buf);
if (ret < 0) {