提交 17c048fc 编写于 作者: J Josef Gajdusek 提交者: Guenter Roeck

hwmon: (emc1403) fix inverted store_hyst()

Attempts to set the hysteresis value to a temperature below the target
limit fails with "write error: Numerical result out of range" due to
an inverted comparison.
Signed-off-by: NJosef Gajdusek <atx@atx.name>
Reviewed-by: NJean Delvare <jdelvare@suse.de>
Cc: stable@vger.kernel.org
[Guenter Roeck: Updated headline and description]
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 d6d211db
......@@ -163,7 +163,7 @@ static ssize_t store_hyst(struct device *dev,
if (retval < 0)
goto fail;
hyst = val - retval * 1000;
hyst = retval * 1000 - val;
hyst = DIV_ROUND_CLOSEST(hyst, 1000);
if (hyst < 0 || hyst > 255) {
retval = -ERANGE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册