]> git.hungrycats.org Git - linux/commitdiff
hwmon: (max1668) Fix writing the minimum temperature
authorGuenter Roeck <linux@roeck-us.net>
Sun, 16 Feb 2014 01:54:06 +0000 (17:54 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 1 Apr 2014 23:58:54 +0000 (00:58 +0100)
commit 500a91571f0a5d0d3242d83802ea2fd1faccc66e upstream.

When trying to set the minimum temperature, the driver was erroneously
writing the maximum temperature into the chip.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/hwmon/max1668.c

index 20d1b2ddffb633fbc8b555a8818e0cab479c4cfa..e19fef7acfa5c9b486a4dd672a8591884943bcb9 100644 (file)
@@ -243,7 +243,7 @@ static ssize_t set_temp_min(struct device *dev,
        data->temp_min[index] = SENSORS_LIMIT(temp/1000, -128, 127);
        if (i2c_smbus_write_byte_data(client,
                                        MAX1668_REG_LIML_WR(index),
-                                       data->temp_max[index]))
+                                       data->temp_min[index]))
                count = -EIO;
        mutex_unlock(&data->update_lock);