aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/max1668.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/max1668.c')
-rw-r--r--drivers/hwmon/max1668.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/max1668.c b/drivers/hwmon/max1668.c
index 666d9f6263eb..a7626358c95d 100644
--- a/drivers/hwmon/max1668.c
+++ b/drivers/hwmon/max1668.c
@@ -215,7 +215,7 @@ static ssize_t set_temp_max(struct device *dev,
215 return ret; 215 return ret;
216 216
217 mutex_lock(&data->update_lock); 217 mutex_lock(&data->update_lock);
218 data->temp_max[index] = SENSORS_LIMIT(temp/1000, -128, 127); 218 data->temp_max[index] = clamp_val(temp/1000, -128, 127);
219 if (i2c_smbus_write_byte_data(client, 219 if (i2c_smbus_write_byte_data(client,
220 MAX1668_REG_LIMH_WR(index), 220 MAX1668_REG_LIMH_WR(index),
221 data->temp_max[index])) 221 data->temp_max[index]))
@@ -240,7 +240,7 @@ static ssize_t set_temp_min(struct device *dev,
240 return ret; 240 return ret;
241 241
242 mutex_lock(&data->update_lock); 242 mutex_lock(&data->update_lock);
243 data->temp_min[index] = SENSORS_LIMIT(temp/1000, -128, 127); 243 data->temp_min[index] = clamp_val(temp/1000, -128, 127);
244 if (i2c_smbus_write_byte_data(client, 244 if (i2c_smbus_write_byte_data(client,
245 MAX1668_REG_LIML_WR(index), 245 MAX1668_REG_LIML_WR(index),
246 data->temp_max[index])) 246 data->temp_max[index]))