Skip to contentSkip to conversation

hwmon: (lm95241) Fix negative

PATCH In review Guenter Roeck 1 participant 1 message Jul 7, 2011 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/3 hwmon: (lm95241) Fix negative

Negative temperatures were returned in degrees C instead of milli-Degrees C. Fix by multiplying with 1000.

---
Candidate for -stable.

 drivers/hwmon/lm95241.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/lm95241.c +1 -1
index 01c638e..4dcc770 100644
@@ -101,7 +101,7 @@ struct lm95241_data {
 static int TempFromReg(u8 val_h, u8 val_l)
 {
 	if (val_h & 0x80)
-		return val_h - 0x100;
+		return (val_h - 0x100) * 1000;
 	return val_h * 1000 + val_l * 1000 / 256;
 }
 
Signature · 7 lines
1.7.3.1


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