diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-25 21:03:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-25 21:03:05 -0400 |
commit | 051c2a9fdebdabec594c151727ce3834ff17d793 (patch) | |
tree | 34e6eb31c64e20f034c65afc3c3c16ccf1dd99ec | |
parent | edffe1b626b39bd7121691dfdecb548431003bbb (diff) | |
parent | 043572d5444116b9d9ad8ae763cf069e7accbc30 (diff) |
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck:
"Fixes to temperature limit and vrm write operations in smsc47m192
driver"
* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (smsc47m192) Fix temperature limit and vrm write operations
-rw-r--r-- | drivers/hwmon/smsc47m192.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c index efee4c59239f..34b9a601ad07 100644 --- a/drivers/hwmon/smsc47m192.c +++ b/drivers/hwmon/smsc47m192.c | |||
@@ -86,7 +86,7 @@ static inline u8 IN_TO_REG(unsigned long val, int n) | |||
86 | */ | 86 | */ |
87 | static inline s8 TEMP_TO_REG(int val) | 87 | static inline s8 TEMP_TO_REG(int val) |
88 | { | 88 | { |
89 | return clamp_val(SCALE(val, 1, 1000), -128000, 127000); | 89 | return SCALE(clamp_val(val, -128000, 127000), 1, 1000); |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline int TEMP_FROM_REG(s8 val) | 92 | static inline int TEMP_FROM_REG(s8 val) |
@@ -384,6 +384,8 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, | |||
384 | err = kstrtoul(buf, 10, &val); | 384 | err = kstrtoul(buf, 10, &val); |
385 | if (err) | 385 | if (err) |
386 | return err; | 386 | return err; |
387 | if (val > 255) | ||
388 | return -EINVAL; | ||
387 | 389 | ||
388 | data->vrm = val; | 390 | data->vrm = val; |
389 | return count; | 391 | return count; |