summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2006-01-09 22:43:08 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2006-02-06 21:02:14 +0100
commit413b64515079a4063776d81067f69cc41bdb34ad (patch)
tree1353d1b285b84963ad48abac3327a397cbc818d2 /drivers/hwmon
parent[PATCH] I2C: Resurrect i2c_smbus_write_i2c_block_data. (diff)
downloadlinux-413b64515079a4063776d81067f69cc41bdb34ad.tar.xz
linux-413b64515079a4063776d81067f69cc41bdb34ad.zip
[PATCH] hwmon: Fix negative temperature readings in lm77 driver
Fix negative temperature readings in lm77 driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Michael Renzmann <mrenzmann@otaku42.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/lm77.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
index a2f420d01fb7..df9e02aaa70a 100644
--- a/drivers/hwmon/lm77.c
+++ b/drivers/hwmon/lm77.c
@@ -87,15 +87,15 @@ static struct i2c_driver lm77_driver = {
/* In the temperature registers, the low 3 bits are not part of the
temperature values; they are the status bits. */
-static inline u16 LM77_TEMP_TO_REG(int temp)
+static inline s16 LM77_TEMP_TO_REG(int temp)
{
int ntemp = SENSORS_LIMIT(temp, LM77_TEMP_MIN, LM77_TEMP_MAX);
- return (u16)((ntemp / 500) * 8);
+ return (ntemp / 500) * 8;
}
-static inline int LM77_TEMP_FROM_REG(u16 reg)
+static inline int LM77_TEMP_FROM_REG(s16 reg)
{
- return ((int)reg / 8) * 500;
+ return (reg / 8) * 500;
}
/* sysfs stuff */