Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rob Herring and committed by
Guenter Roeck
5cfc392c b0d51ada

+3 -5
+3 -5
drivers/hwmon/max6650.c
··· 26 26 #include <linux/hwmon.h> 27 27 #include <linux/hwmon-sysfs.h> 28 28 #include <linux/err.h> 29 - #include <linux/of_device.h> 29 + #include <linux/of.h> 30 30 #include <linux/thermal.h> 31 31 32 32 /* ··· 763 763 { 764 764 struct thermal_cooling_device *cooling_dev; 765 765 struct device *dev = &client->dev; 766 - const struct of_device_id *of_id = 767 - of_match_device(of_match_ptr(max6650_dt_match), dev); 768 766 struct max6650_data *data; 769 767 struct device *hwmon_dev; 770 768 int err; ··· 774 776 data->client = client; 775 777 i2c_set_clientdata(client, data); 776 778 mutex_init(&data->update_lock); 777 - data->nr_fans = of_id ? (int)(uintptr_t)of_id->data : 778 - i2c_match_id(max6650_id, client)->driver_data; 779 + 780 + data->nr_fans = (uintptr_t)i2c_get_match_data(client); 779 781 780 782 /* 781 783 * Initialize the max6650 chip