diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-12 11:03:57 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-12 11:03:57 -0800 |
commit | c8469441c4415b9738327f64c74a5b76bf465815 (patch) | |
tree | bb99933464ccbcdef528d21b4c2ee843da56d98f /drivers/hwmon/vt8231.c | |
parent | 11ec50caedb56e3a87715edeff6a1852e6ae5416 (diff) | |
parent | 3806b45ba4655147a011df03242cc197ab986c43 (diff) |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Pull hwmon fixes from Jean Delvare.
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: Prevent some divide by zeros in FAN_TO_REG()
hwmon: (w83l768ng) Fix fan speed control range
hwmon: (w83l786ng) Fix fan speed control mode setting and reporting
hwmon: (lm90) Unregister hwmon device if interrupt setup fails
Diffstat (limited to 'drivers/hwmon/vt8231.c')
-rw-r--r-- | drivers/hwmon/vt8231.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c index 0e7017841f7d..aee14e2192f8 100644 --- a/drivers/hwmon/vt8231.c +++ b/drivers/hwmon/vt8231.c @@ -145,7 +145,7 @@ static const u8 regtempmin[] = { 0x3a, 0x3e, 0x2c, 0x2e, 0x30, 0x32 }; */ static inline u8 FAN_TO_REG(long rpm, int div) { - if (rpm == 0) + if (rpm <= 0 || rpm > 1310720) return 0; return clamp_val(1310720 / (rpm * div), 1, 255); } |