]> git.ipfire.org Git - thirdparty/linux.git/commit
hwmon: (amc6821) Stop accepting invalid pwm values
authorGuenter Roeck <linux@roeck-us.net>
Thu, 27 Jun 2024 00:21:54 +0000 (17:21 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 8 Jul 2024 14:52:36 +0000 (07:52 -0700)
commitaf4d04b8ce08a734889fb0777059063635242614
tree8e49b82eacef331972fe71c6506bee0c455fefc7
parent5c1de37969b7bc0abcb20b86e91e70caebbd4f89
hwmon: (amc6821) Stop accepting invalid pwm values

The pwm value range is well defined from 0..255. Don't accept any values
outside this range.

This changes the valid range of pwm1_auto_point2_pwm from 0..254 to 0..255,
meaning it can now be equivalent to not only pwm1_auto_point1_pwm (which is
always 0) but also to pwm1_auto_point3_pwm (which is always 255). While
that may not be practical, there seems to be no technical reason for
preventing a user from doing it.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/amc6821.c