diff options
Diffstat (limited to 'include/linux/hwmon.h')
-rw-r--r-- | include/linux/hwmon.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index bf90e6001e3..0efd994c37f 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -20,5 +20,16 @@ struct class_device *hwmon_device_register(struct device *dev); void hwmon_device_unregister(struct class_device *cdev); +/* Scale user input to sensible values */ +static inline int SENSORS_LIMIT(long value, long low, long high) +{ + if (value < low) + return low; + else if (value > high) + return high; + else + return value; +} + #endif |