aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm63.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/lm63.c')
-rw-r--r--drivers/hwmon/lm63.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index eed4d9401788..f644a2e57599 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -209,9 +209,9 @@ static inline int lut_temp_to_reg(struct lm63_data *data, long val)
209{ 209{
210 val -= data->temp2_offset; 210 val -= data->temp2_offset;
211 if (data->lut_temp_highres) 211 if (data->lut_temp_highres)
212 return DIV_ROUND_CLOSEST(SENSORS_LIMIT(val, 0, 127500), 500); 212 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127500), 500);
213 else 213 else
214 return DIV_ROUND_CLOSEST(SENSORS_LIMIT(val, 0, 127000), 1000); 214 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127000), 1000);
215} 215}
216 216
217/* 217/*
@@ -415,7 +415,7 @@ static ssize_t set_pwm1(struct device *dev, struct device_attribute *devattr,
415 return err; 415 return err;
416 416
417 reg = nr ? LM63_REG_LUT_PWM(nr - 1) : LM63_REG_PWM_VALUE; 417 reg = nr ? LM63_REG_LUT_PWM(nr - 1) : LM63_REG_PWM_VALUE;
418 val = SENSORS_LIMIT(val, 0, 255); 418 val = clamp_val(val, 0, 255);
419 419
420 mutex_lock(&data->update_lock); 420 mutex_lock(&data->update_lock);
421 data->pwm1[nr] = data->pwm_highres ? val : 421 data->pwm1[nr] = data->pwm_highres ? val :
@@ -700,7 +700,7 @@ static ssize_t set_update_interval(struct device *dev,
700 return err; 700 return err;
701 701
702 mutex_lock(&data->update_lock); 702 mutex_lock(&data->update_lock);
703 lm63_set_convrate(client, data, SENSORS_LIMIT(val, 0, 100000)); 703 lm63_set_convrate(client, data, clamp_val(val, 0, 100000));
704 mutex_unlock(&data->update_lock); 704 mutex_unlock(&data->update_lock);
705 705
706 return count; 706 return count;