|
@@ -163,7 +163,7 @@ static ssize_t store_hyst(struct device *dev,
|
|
if (retval < 0)
|
|
if (retval < 0)
|
|
goto fail;
|
|
goto fail;
|
|
|
|
|
|
- hyst = val - retval * 1000;
|
|
|
|
|
|
+ hyst = retval * 1000 - val;
|
|
hyst = DIV_ROUND_CLOSEST(hyst, 1000);
|
|
hyst = DIV_ROUND_CLOSEST(hyst, 1000);
|
|
if (hyst < 0 || hyst > 255) {
|
|
if (hyst < 0 || hyst > 255) {
|
|
retval = -ERANGE;
|
|
retval = -ERANGE;
|