From: Guenter Roeck Date: Thu, 17 Jul 2014 00:40:31 +0000 (-0700) Subject: hwmon: (adt7470) Fix writes to temperature limit registers X-Git-Tag: v3.2.64~279 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8bac1698272b067da1d45a7027661ea855eaad8;p=pandora-kernel.git 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 Reviewed-by: Axel Lin [bwh: Backported to 3.2: driver was using SENSORS_LIMIT(), which we can replace with clamp_val()] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed