summaryrefslogtreecommitdiff
path: root/drivers/hwmon/emc2103.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-07-04 00:44:23 +0400
committerGuenter Roeck <linux@roeck-us.net>2014-07-07 16:49:25 +0400
commit145e74a4e5022225adb84f4e5d4fff7938475c35 (patch)
tree4fd28b2112312ff139825dee37600a7f6cda7707 /drivers/hwmon/emc2103.c
parentc024044d4da2c9c3b32933b4235df1e409293b84 (diff)
downloadlinux-145e74a4e5022225adb84f4e5d4fff7938475c35.tar.xz
hwmon: (adm1031) Fix writes to limit registers
Upper limit for write operations to temperature limit registers was clamped to a fractional value. However, limit registers do not support fractional values. As a result, upper limits of 127.5 degrees C or higher resulted in a rounded limit of 128 degrees C. Since limit registers are signed, this was stored as -128 degrees C. Clamp limits to (-55, +127) degrees C to solve the problem. Value on writes to auto_temp[12]_min and auto_temp[12]_max were not clamped at all, but masked. As a result, out-of-range writes resulted in a more or less arbitrary limit. Clamp those attributes to (0, 127) degrees C for more predictable results. Cc: Axel Lin <axel.lin@ingics.com> Cc: stable@vger.kernel.org Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/emc2103.c')
0 files changed, 0 insertions, 0 deletions