summaryrefslogtreecommitdiff
path: root/drivers/hwmon/w83627ehf.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-10-26 13:48:49 -0700
committerJohn Stultz <john.stultz@linaro.org>2011-10-26 13:48:49 -0700
commit2216773fc021964a413409141d439de4f6a108f7 (patch)
tree7b2f8cdcdf5fb05d75bd92f0c8d9ac635ceec48c /drivers/hwmon/w83627ehf.c
parent42ac8ca89aef66618e8ae2d6e48e3f523bfcd69d (diff)
parentaf1bdb79ca64ceadc7b44b11929b384eff66ce59 (diff)
Merge branch 'upstream/linaro-3.1' into linaro-android-3.1-agreen-rebaselinux-linaro-3.1-2011.10-2-android-0
Diffstat (limited to 'drivers/hwmon/w83627ehf.c')
-rw-r--r--drivers/hwmon/w83627ehf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 7b0260dc76f..36d7f270b14 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -390,7 +390,7 @@ temp_from_reg(u16 reg, s16 regval)
{
if (is_word_sized(reg))
return LM75_TEMP_FROM_REG(regval);
- return regval * 1000;
+ return ((s8)regval) * 1000;
}
static inline u16
@@ -398,7 +398,8 @@ temp_to_reg(u16 reg, long temp)
{
if (is_word_sized(reg))
return LM75_TEMP_TO_REG(temp);
- return DIV_ROUND_CLOSEST(SENSORS_LIMIT(temp, -127000, 128000), 1000);
+ return (s8)DIV_ROUND_CLOSEST(SENSORS_LIMIT(temp, -127000, 128000),
+ 1000);
}
/* Some of analog inputs have internal scaling (2x), 8mV is ADC LSB */