Skip to contentSkip to conversation

hwmon: (max1668) Fix writing the minimum temperature

PATCH In review Guenter Roeck 2 participants 2 messages Feb 16, 2014 – Feb 18, 2014 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/3 hwmon: (max1668) Fix writing the minimum temperature

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

---
Candidate for -stable.

 drivers/hwmon/max1668.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max1668.c +1 -1
index a762635..029b65e 100644
@@ -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);
 
Signature · 7 lines
1.7.9.7


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Reviewed-by on v1 1/3
#1 lore raw
Quoted 15 lines · Guenter Roeck

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

---
Candidate for -stable.

 drivers/hwmon/max1668.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max1668.c +0 -0
index a762635..029b65e 100644

drivers/hwmon/max1668.c static ssize_t set_temp_min(struct device *dev, · line 249

Quoted 8 lines
drivers/hwmon/max1668.c +1 -1
@@ -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);
 

Huh, bad bug, good catch.

Definitely good for -stable, even though it may not be the most popular hwmon driver.

Signature · 7 lines
Jean Delvare
Suse L3 Support

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors