From: Guenter Roeck Date: Sun, 16 Feb 2014 01:54:06 +0000 (-0800) Subject: hwmon: (max1668) Fix writing the minimum temperature X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=755ac7af96bdc50bf65254ac3699e0279a342440;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git hwmon: (max1668) Fix writing the minimum temperature 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 Reviewed-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwmon/max1668.c b/drivers/hwmon/max1668.c index a7626358c95..029b65e6c58 100644 --- a/drivers/hwmon/max1668.c +++ b/drivers/hwmon/max1668.c @@ -243,7 +243,7 @@ static ssize_t set_temp_min(struct device *dev, data->temp_min[index] = clamp_val(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);