]> Gentwo Git Trees - linux/.git/commit
hwmon: (ina238) Correctly clamp power limits
authorGuenter Roeck <linux@roeck-us.net>
Fri, 29 Aug 2025 18:51:20 +0000 (11:51 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 1 Sep 2025 15:03:05 +0000 (08:03 -0700)
commitc2623573178bab32990695fb729e9b69710ed66d
treed58cc54a25cc72677f42afb75b31f9a8782e5641
parentbd7e7bc2cc2024035dfbc8239c9f4d8675793445
hwmon: (ina238) Correctly clamp power limits

ina238_write_power() was attempting to clamp the user input but was
throwing away the result. Ensure that we clamp the value to the
appropriate range before it is converted into a register value.

Fixes: 0d9f596b1fe34 ("hwmon: (ina238) Modify the calculation formula to adapt to different chips")
Cc: Wenliang Yan <wenliang202407@163.com>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina238.c