hwmon: (adt7470) Fix writes to temperature limit registers
authorGuenter Roeck <linux@roeck-us.net>
Thu, 17 Jul 2014 00:40:31 +0000 (17:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Jul 2014 15:05:57 +0000 (08:05 -0700)
commitee0af1ad5166963cbe11d3cd3c58a9386a60665f
treeef581bdc61d06c9c4a4428e78e7ceb4798be10be
parent2fd37381b1f09aa129c1a67bfe883b8f656c3ef0
hwmon: (adt7470) Fix writes to temperature limit registers

commit de12d6f4b10b21854441f5242dcb29ea96181e58 upstream.

Temperature limit registers are signed. Limits therefore need
to be clamped to (-128, 127) degrees C and not to (0, 255)
degrees C.

Without this fix, writing a limit of 128 degrees C sets the
actual limit to -128 degrees C.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/adt7470.c