]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (pmbus/fsp-3y) Remove use of i2c_match_id()
authorAndrew Davis <afd@ti.com>
Fri, 6 Mar 2026 17:16:50 +0000 (11:16 -0600)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Mar 2026 02:45:06 +0000 (19:45 -0700)
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>
drivers/hwmon/pmbus/fsp-3y.c

index a4dc09e2ef75acf06233b86d84821c3bc8e7cd62..cad4d2330003655f4ace92f706c1f23356e22d54 100644 (file)
@@ -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 = {