mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
hwmon: Retire SENSORS_LIMIT
SENSORS_LIMIT and clamp_val have the same functionality, so retire SENSORS_LIMIT as it is no longer needed. Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]>
This commit is contained in:
parent
c73bad746c
commit
c25fb81629
2 changed files with 4 additions and 16 deletions
|
|
@ -722,14 +722,14 @@ add/subtract if it has been divided before the add/subtract.
|
|||
What to do if a value is found to be invalid, depends on the type of the
|
||||
sysfs attribute that is being set. If it is a continuous setting like a
|
||||
tempX_max or inX_max attribute, then the value should be clamped to its
|
||||
limits using SENSORS_LIMIT(value, min_limit, max_limit). If it is not
|
||||
continuous like for example a tempX_type, then when an invalid value is
|
||||
written, -EINVAL should be returned.
|
||||
limits using clamp_val(value, min_limit, max_limit). If it is not continuous
|
||||
like for example a tempX_type, then when an invalid value is written,
|
||||
-EINVAL should be returned.
|
||||
|
||||
Example1, temp1_max, register is a signed 8 bit value (-128 - 127 degrees):
|
||||
|
||||
long v = simple_strtol(buf, NULL, 10) / 1000;
|
||||
v = SENSORS_LIMIT(v, -128, 127);
|
||||
v = clamp_val(v, -128, 127);
|
||||
/* write v to register */
|
||||
|
||||
Example2, fan divider setting, valid values 2, 4 and 8:
|
||||
|
|
|
|||
Loading…
Reference in a new issue