]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: pac1934: Fix clamped value in pac1934_reg_snapshot
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 2 Dec 2025 18:13:06 +0000 (19:13 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:14:10 +0000 (11:14 +0000)
commitda934ef0fdff5ba21e82ec3ab3f95fe73137b0c9
tree711d87733d524306a6281e3b9f2efb969b4a312c
parent92452b1760ff2d1d411414965d4d06f75e1bda9a
iio: adc: pac1934: Fix clamped value in pac1934_reg_snapshot

The local variable 'curr_energy' was never clamped to
PAC_193X_MIN_POWER_ACC or PAC_193X_MAX_POWER_ACC because the return
value of clamp() was not used. Fix this by assigning the clamped value
back to 'curr_energy'.

Cc: stable@vger.kernel.org
Fixes: 0fb528c8255b ("iio: adc: adding support for PAC193x")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/pac1934.c