diff options
Diffstat (limited to 'drivers/hwmon/sis5595.c')
-rw-r--r-- | drivers/hwmon/sis5595.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 06ce3c911db9..c35847a1a0a3 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -132,7 +132,7 @@ static struct platform_device *pdev; */ static inline u8 IN_TO_REG(unsigned long val) { - unsigned long nval = SENSORS_LIMIT(val, 0, 4080); + unsigned long nval = clamp_val(val, 0, 4080); return (nval + 8) / 16; } #define IN_FROM_REG(val) ((val) * 16) @@ -141,7 +141,7 @@ static inline u8 FAN_TO_REG(long rpm, int div) { if (rpm <= 0) return 255; - return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254); + return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); } static inline int FAN_FROM_REG(u8 val, int div) @@ -159,7 +159,7 @@ static inline int TEMP_FROM_REG(s8 val) } static inline s8 TEMP_TO_REG(int val) { - int nval = SENSORS_LIMIT(val, -54120, 157530) ; + int nval = clamp_val(val, -54120, 157530) ; return nval < 0 ? (nval - 5212 - 415) / 830 : (nval - 5212 + 415) / 830; } |