Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] hwmon: move SENSORS_LIMIT to hwmon.h

Move SENSORS_LIMIT from i2c-sensor.h to hwmon.h, as it is in no way
related to i2c.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Jean Delvare and committed by
Greg Kroah-Hartman
53ae11b0 b6d7b3d1

+12 -13
+1 -1
drivers/hwmon/lm75.h
··· 25 25 which contains this code, we don't worry about the wasted space. 26 26 */ 27 27 28 - #include <linux/i2c-sensor.h> 28 + #include <linux/hwmon.h> 29 29 30 30 /* straight from the datasheet */ 31 31 #define LM75_TEMP_MIN (-55000)
+11
include/linux/hwmon.h
··· 20 20 21 21 void hwmon_device_unregister(struct class_device *cdev); 22 22 23 + /* Scale user input to sensible values */ 24 + static inline int SENSORS_LIMIT(long value, long low, long high) 25 + { 26 + if (value < low) 27 + return low; 28 + else if (value > high) 29 + return high; 30 + else 31 + return value; 32 + } 33 + 23 34 #endif 24 35
-12
include/linux/i2c-sensor.h
··· 242 242 struct i2c_address_data *address_data, 243 243 int (*found_proc) (struct i2c_adapter *, int, int)); 244 244 245 - 246 - /* This macro is used to scale user-input to sensible values in almost all 247 - chip drivers. */ 248 - static inline int SENSORS_LIMIT(long value, long low, long high) 249 - { 250 - if (value < low) 251 - return low; 252 - else if (value > high) 253 - return high; 254 - else 255 - return value; 256 - } 257 245 #endif /* def _LINUX_I2C_SENSOR_H */