diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-01 08:47:44 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-01 08:47:44 -0700 |
commit | bf61c8840efe60fd8f91446860b63338fb424158 (patch) | |
tree | 7a71832407a4f0d6346db773343f4c3ae2257b19 /drivers/hwmon/tmp401.c | |
parent | 5846115b30f3a881e542c8bfde59a699c1c13740 (diff) | |
parent | 0c6a61657da78098472fd0eb71cc01f2387fa1bb (diff) |
Merge branch 'next' into for-linus
Prepare first set of updates for 3.10 merge window.
Diffstat (limited to 'drivers/hwmon/tmp401.c')
-rw-r--r-- | drivers/hwmon/tmp401.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c index e62054875164..c85f6967ccc3 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c @@ -142,10 +142,10 @@ static int tmp401_register_to_temp(u16 reg, u8 config) static u16 tmp401_temp_to_register(long temp, u8 config) { if (config & TMP401_CONFIG_RANGE) { - temp = SENSORS_LIMIT(temp, -64000, 191000); + temp = clamp_val(temp, -64000, 191000); temp += 64000; } else - temp = SENSORS_LIMIT(temp, 0, 127000); + temp = clamp_val(temp, 0, 127000); return (temp * 160 + 312) / 625; } @@ -163,10 +163,10 @@ static int tmp401_crit_register_to_temp(u8 reg, u8 config) static u8 tmp401_crit_temp_to_register(long temp, u8 config) { if (config & TMP401_CONFIG_RANGE) { - temp = SENSORS_LIMIT(temp, -64000, 191000); + temp = clamp_val(temp, -64000, 191000); temp += 64000; } else - temp = SENSORS_LIMIT(temp, 0, 127000); + temp = clamp_val(temp, 0, 127000); return (temp + 500) / 1000; } @@ -417,14 +417,14 @@ static ssize_t store_temp_crit_hyst(struct device *dev, struct device_attribute return -EINVAL; if (data->config & TMP401_CONFIG_RANGE) - val = SENSORS_LIMIT(val, -64000, 191000); + val = clamp_val(val, -64000, 191000); else - val = SENSORS_LIMIT(val, 0, 127000); + val = clamp_val(val, 0, 127000); mutex_lock(&data->update_lock); temp = tmp401_crit_register_to_temp(data->temp_crit[index], data->config); - val = SENSORS_LIMIT(val, temp - 255000, temp); + val = clamp_val(val, temp - 255000, temp); reg = ((temp - val) + 500) / 1000; i2c_smbus_write_byte_data(to_i2c_client(dev), |