]> Gentwo Git Trees - linux/.git/commit
hwmon: (ina238) Correctly clamp temperature
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Fri, 29 Aug 2025 03:05:10 +0000 (15:05 +1200)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 29 Aug 2025 13:56:30 +0000 (06:56 -0700)
commit98fd069dd87386d87eaf439e3c7b5767618926d2
tree95b51780f92fc3e1a075753c774edf0e85c8c919
parent1180c79fbf36e4c02e76ae4658509523437e52a4
hwmon: (ina238) Correctly clamp temperature

ina238_write_temp() 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: 0d9f596b1fe3 ("hwmon: (ina238) Modify the calculation formula to adapt to different chips")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20250829030512.1179998-3-chris.packham@alliedtelesis.co.nz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina238.c