diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/adm1031.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index 257ec53ae723..ac841fa3a369 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c @@ -242,9 +242,8 @@ static int FAN_TO_REG(int reg, int div) static int AUTO_TEMP_MAX_TO_REG(int val, int reg, int pwm) { int ret; - int range = val - AUTO_TEMP_MIN_FROM_REG(reg); + int range = ((val - AUTO_TEMP_MIN_FROM_REG(reg)) * 10) / (16 - pwm); - range = ((val - AUTO_TEMP_MIN_FROM_REG(reg))*10)/(16 - pwm); ret = ((reg & 0xf8) | (range < 10000 ? 0 : range < 20000 ? 1 : |