Merge branch 'drm-armada-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into...
[firefly-linux-kernel-4.4.55.git] / drivers / hwmon / lm75.c
index 6753fd940c7623a0fbbd2790c7b7bf5af43f2a18..e4e57bbafb10eeb621ad03ff03e8985030c43e4a 100644 (file)
@@ -104,7 +104,7 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
 
 /* sysfs attributes for hwmon */
 
-static int lm75_read_temp(void *dev, long *temp)
+static int lm75_read_temp(void *dev, int *temp)
 {
        struct lm75_data *data = lm75_update_device(dev);
 
@@ -177,6 +177,10 @@ static struct attribute *lm75_attrs[] = {
 };
 ATTRIBUTE_GROUPS(lm75);
 
+static const struct thermal_zone_of_device_ops lm75_of_thermal_ops = {
+       .get_temp = lm75_read_temp,
+};
+
 /*-----------------------------------------------------------------------*/
 
 /* device probe and removal */
@@ -296,10 +300,9 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
        if (IS_ERR(data->hwmon_dev))
                return PTR_ERR(data->hwmon_dev);
 
-       data->tz = thermal_zone_of_sensor_register(data->hwmon_dev,
-                                                  0,
+       data->tz = thermal_zone_of_sensor_register(data->hwmon_dev, 0,
                                                   data->hwmon_dev,
-                                                  lm75_read_temp, NULL);
+                                                  &lm75_of_thermal_ops);
        if (IS_ERR(data->tz))
                data->tz = NULL;