diff options
Diffstat (limited to 'drivers/hwmon/max6650.c')
-rw-r--r-- | drivers/hwmon/max6650.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 3d9d371c35b5..f8d4534ce172 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c @@ -321,7 +321,7 @@ static SENSOR_DEVICE_ATTR_RO(gpio2_alarm, alarm, MAX6650_ALRM_GPIO2); static umode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct max6650_data *data = dev_get_drvdata(dev); struct device_attribute *devattr; @@ -757,8 +757,9 @@ static const struct hwmon_chip_info max6650_chip_info = { .info = max6650_info, }; -static int max6650_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static const struct i2c_device_id max6650_id[]; + +static int max6650_probe(struct i2c_client *client) { struct thermal_cooling_device *cooling_dev; struct device *dev = &client->dev; @@ -775,7 +776,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 : id->driver_data; + data->nr_fans = of_id ? (int)(uintptr_t)of_id->data : + i2c_match_id(max6650_id, client)->driver_data; /* * Initialize the max6650 chip @@ -817,7 +819,7 @@ static struct i2c_driver max6650_driver = { .name = "max6650", .of_match_table = of_match_ptr(max6650_dt_match), }, - .probe = max6650_probe, + .probe_new = max6650_probe, .id_table = max6650_id, }; |