summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2026-03-06 11:16:42 -0600
committerGuenter Roeck <linux@roeck-us.net>2026-03-30 19:45:05 -0700
commit3ea44f8d76411c1f240062a16298668dd8907400 (patch)
tree4412ab4a6f587282e487b3f2fc16de50567e1992 /drivers
parentee175259073320139aa8b94ab1225d98e8c6bcfc (diff)
downloadlinux-next-3ea44f8d76411c1f240062a16298668dd8907400.tar.gz
linux-next-3ea44f8d76411c1f240062a16298668dd8907400.zip
hwmon: (pmbus/bel-pfe) 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 doesn't need the i2c_device_id passed in so we do not need to have that forward declared, allowing us to remove that. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20260306171652.951274-2-afd@ti.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/pmbus/bel-pfe.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hwmon/pmbus/bel-pfe.c b/drivers/hwmon/pmbus/bel-pfe.c
index ddf9d9a2958c..6499556f735b 100644
--- a/drivers/hwmon/pmbus/bel-pfe.c
+++ b/drivers/hwmon/pmbus/bel-pfe.c
@@ -88,13 +88,10 @@ static struct pmbus_driver_info pfe_driver_info[] = {
},
};
-static const struct i2c_device_id pfe_device_id[];
-
static int pfe_pmbus_probe(struct i2c_client *client)
{
- int model;
+ int model = (uintptr_t)i2c_get_match_data(client);
- model = (int)i2c_match_id(pfe_device_id, client)->driver_data;
client->dev.platform_data = &pfe_plat_data;
/*