hwmon: (emc6w201) Fix temperature limit range
Temperature limit range is [-127, 127], not [-127, 128]. The wrong range caused a bad limit to be written into the chip if the limit was set to a value of 128 degrees C or above. Also use DIV_ROUND_CLOSEST instead of a plain divide operation to reduce the rounding error when writing temperature limits. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NJean Delvare <jdelvare@suse.de>
Showing
想要评论请 注册 或 登录