diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2013-02-21 16:16:55 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-02-22 10:07:30 +0100 |
commit | edb15d83a875a1f4b1576188844db5c330c3267d (patch) | |
tree | 74d54eab401b6ccf2a6ad4821227108a8d160f03 /drivers/hwmon/vt1211.c | |
parent | 8bfc245f9ad7bd4e461179e4e7852ef99b8b6144 (diff) | |
parent | a0b1c42951dd06ec83cc1bc2c9788131d9fefcd8 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into mips-for-linux-next
Conflicts:
include/linux/ssb/ssb_driver_gige.h
Also resolves a logical merge conflict in drivers/net/ethernet/broadcom/-
bgmac.c due to change of an API.
Diffstat (limited to 'drivers/hwmon/vt1211.c')
-rw-r--r-- | drivers/hwmon/vt1211.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hwmon/vt1211.c b/drivers/hwmon/vt1211.c index 751703059fae..dcc62f80f67b 100644 --- a/drivers/hwmon/vt1211.c +++ b/drivers/hwmon/vt1211.c @@ -158,7 +158,7 @@ struct vt1211_data { #define IN_FROM_REG(ix, reg) ((reg) < 3 ? 0 : (ix) == 5 ? \ (((reg) - 3) * 15882 + 479) / 958 : \ (((reg) - 3) * 10000 + 479) / 958) -#define IN_TO_REG(ix, val) (SENSORS_LIMIT((ix) == 5 ? \ +#define IN_TO_REG(ix, val) (clamp_val((ix) == 5 ? \ ((val) * 958 + 7941) / 15882 + 3 : \ ((val) * 958 + 5000) / 10000 + 3, 0, 255)) @@ -173,7 +173,7 @@ struct vt1211_data { (ix) == 1 ? (reg) < 51 ? 0 : \ ((reg) - 51) * 1000 : \ ((253 - (reg)) * 2200 + 105) / 210) -#define TEMP_TO_REG(ix, val) SENSORS_LIMIT( \ +#define TEMP_TO_REG(ix, val) clamp_val( \ ((ix) == 0 ? ((val) + 500) / 1000 : \ (ix) == 1 ? ((val) + 500) / 1000 + 51 : \ 253 - ((val) * 210 + 1100) / 2200), 0, 255) @@ -183,7 +183,7 @@ struct vt1211_data { #define RPM_FROM_REG(reg, div) (((reg) == 0) || ((reg) == 255) ? 0 : \ 1310720 / (reg) / DIV_FROM_REG(div)) #define RPM_TO_REG(val, div) ((val) == 0 ? 255 : \ - SENSORS_LIMIT((1310720 / (val) / \ + clamp_val((1310720 / (val) / \ DIV_FROM_REG(div)), 1, 254)) /* --------------------------------------------------------------------- @@ -687,7 +687,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, data->fan_ctl)); break; case SHOW_SET_PWM_FREQ: - val = 135000 / SENSORS_LIMIT(val, 135000 >> 7, 135000); + val = 135000 / clamp_val(val, 135000 >> 7, 135000); /* calculate tmp = log2(val) */ tmp = 0; for (val >>= 1; val > 0; val >>= 1) @@ -845,7 +845,7 @@ static ssize_t set_pwm_auto_point_pwm(struct device *dev, return err; mutex_lock(&data->update_lock); - data->pwm_auto_pwm[ix][ap] = SENSORS_LIMIT(val, 0, 255); + data->pwm_auto_pwm[ix][ap] = clamp_val(val, 0, 255); vt1211_write8(data, VT1211_REG_PWM_AUTO_PWM(ix, ap), data->pwm_auto_pwm[ix][ap]); mutex_unlock(&data->update_lock); |