]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
hwmon: (ina238) Correctly clamp shunt voltage limit
authorGuenter Roeck <linux@roeck-us.net>
Fri, 29 Aug 2025 13:49:51 +0000 (06:49 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 1 Sep 2025 15:03:05 +0000 (08:03 -0700)
commitbd7e7bc2cc2024035dfbc8239c9f4d8675793445
treeeb1ee7f73053e8ffaedff8baaddb99f1075a0a88
parent98fd069dd87386d87eaf439e3c7b5767618926d2
hwmon: (ina238) Correctly clamp shunt voltage limit

When clamping a register value, the result needs to be masked against the
register size. This was missing, resulting in errors when trying to write
negative limits. Fix by masking the clamping result against the register
size.

Fixes: eacb52f010a80 ("hwmon: Driver for Texas Instruments INA238")
Cc: Nathan Rossi <nathan.rossi@digi.com>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina238.c