aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/emc2103.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c
index 24e395c5907d..4b870ee9b0d3 100644
--- a/drivers/hwmon/emc2103.c
+++ b/drivers/hwmon/emc2103.c
@@ -251,7 +251,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da,
251 if (result < 0) 251 if (result < 0)
252 return result; 252 return result;
253 253
254 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -63, 127); 254 val = DIV_ROUND_CLOSEST(clamp_val(val, -63000, 127000), 1000);
255 255
256 mutex_lock(&data->update_lock); 256 mutex_lock(&data->update_lock);
257 data->temp_min[nr] = val; 257 data->temp_min[nr] = val;
@@ -273,7 +273,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da,
273 if (result < 0) 273 if (result < 0)
274 return result; 274 return result;
275 275
276 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -63, 127); 276 val = DIV_ROUND_CLOSEST(clamp_val(val, -63000, 127000), 1000);
277 277
278 mutex_lock(&data->update_lock); 278 mutex_lock(&data->update_lock);
279 data->temp_max[nr] = val; 279 data->temp_max[nr] = val;