summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2026-03-06 20:16:50 +0300
committerGuenter Roeck <linux@roeck-us.net>2026-03-31 05:45:06 +0300
commit6f0a5e6d52234043ffd01324cae1d5da87607b5b (patch)
tree6d5b5f586486452a96860b7abae7838a752dacfa
parent8ec910b1709ced46188c12afc9fd2ef6634d6245 (diff)
downloadlinux-6f0a5e6d52234043ffd01324cae1d5da87607b5b.tar.xz
hwmon: (pmbus/fsp-3y) 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 can be done instead with i2c_client_get_device_id() which doesn't need the i2c_device_id passed in so we do not need to have that forward declared, allowing us to move the i2c_device_id table down to its more natural spot with the other module info. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20260306171652.951274-10-afd@ti.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/pmbus/fsp-3y.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/hwmon/pmbus/fsp-3y.c b/drivers/hwmon/pmbus/fsp-3y.c
index a4dc09e2ef75..cad4d2330003 100644
--- a/drivers/hwmon/pmbus/fsp-3y.c
+++ b/drivers/hwmon/pmbus/fsp-3y.c
@@ -222,12 +222,6 @@ static int fsp3y_detect(struct i2c_client *client)
return -ENODEV;
}
-static const struct i2c_device_id fsp3y_id[] = {
- {"ym2151e", ym2151e},
- {"yh5151e", yh5151e},
- { }
-};
-
static int fsp3y_probe(struct i2c_client *client)
{
struct fsp3y_data *data;
@@ -242,7 +236,7 @@ static int fsp3y_probe(struct i2c_client *client)
if (data->chip < 0)
return data->chip;
- id = i2c_match_id(fsp3y_id, client);
+ id = i2c_client_get_device_id(client);
if (data->chip != id->driver_data)
dev_warn(&client->dev, "Device mismatch: Configured %s (%d), detected %d\n",
id->name, (int)id->driver_data, data->chip);
@@ -276,6 +270,11 @@ static int fsp3y_probe(struct i2c_client *client)
return pmbus_do_probe(client, &data->info);
}
+static const struct i2c_device_id fsp3y_id[] = {
+ {"ym2151e", ym2151e},
+ {"yh5151e", yh5151e},
+ { }
+};
MODULE_DEVICE_TABLE(i2c, fsp3y_id);
static struct i2c_driver fsp3y_driver = {