From: Guenter Roeck Date: Wed, 30 Jul 2014 05:23:12 +0000 (-0700) Subject: hwmon: (lm85) Fix various errors on attribute writes X-Git-Tag: omap-for-v3.17/fixes-against-rc2~159^2~86 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3248c3b771ddd9d31695da17ba350eb6e1b80a53;p=pandora-kernel.git hwmon: (lm85) Fix various errors on attribute writes Temperature limit register writes did not account for negative numbers. As a result, writing -127000 resulted in -126000 written into the temperature limit register. This problem affected temp[1-3]_min, temp[1-3]_max, temp[1-3]_auto_temp_crit, and temp[1-3]_auto_temp_min. When writing pwm[1-3]_freq, a long variable was auto-converted into an int without range check. Wiring values larger than MAXINT resulted in unexpected register values. When writing temp[1-3]_auto_temp_max, an unsigned long variable was auto-converted into an int without range check. Writing values larger than MAXINT resulted in unexpected register values. vrm is an u8, so the written value needs to be limited to [0, 255]. Cc: Axel Lin Cc: stable@vger.kernel.org Reviewed-by: Axel Lin Signed-off-by: Guenter Roeck --- Reading git-diff-tree failed