diff options
author | Rob Herring <robh@kernel.org> | 2023-11-15 14:57:00 -0600 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-12-11 06:20:28 -0800 |
commit | 5cfc392cc93b42d5b0bdea12eecb649887b9991d (patch) | |
tree | 4b4a5e30f190404ffdba73c5e4b452782e49d9f8 | |
parent | b0d51ada88a326e2bb58323b64879a596cd339f3 (diff) | |
download | lwn-5cfc392cc93b42d5b0bdea12eecb649887b9991d.tar.gz lwn-5cfc392cc93b42d5b0bdea12eecb649887b9991d.zip |
hwmon: (max6650) Use i2c_get_match_data()
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c_match_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231115205703.3730448-1-robh@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/max6650.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index cc8428a3045d..9649c6611d5f 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c @@ -26,7 +26,7 @@ #include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/err.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/thermal.h> /* @@ -763,8 +763,6 @@ static int max6650_probe(struct i2c_client *client) { struct thermal_cooling_device *cooling_dev; struct device *dev = &client->dev; - const struct of_device_id *of_id = - of_match_device(of_match_ptr(max6650_dt_match), dev); struct max6650_data *data; struct device *hwmon_dev; int err; @@ -776,8 +774,8 @@ static int max6650_probe(struct i2c_client *client) data->client = client; i2c_set_clientdata(client, data); mutex_init(&data->update_lock); - data->nr_fans = of_id ? (int)(uintptr_t)of_id->data : - i2c_match_id(max6650_id, client)->driver_data; + + data->nr_fans = (uintptr_t)i2c_get_match_data(client); /* * Initialize the max6650 chip |