]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad7606_spi: fix reg write value mask
authorDavid Lechner <dlechner@baylibre.com>
Tue, 29 Apr 2025 01:55:34 +0000 (20:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:27 +0000 (11:05 +0100)
commitbf68c0f4c75f91eb59aacd22fa246a795e4d1e30
treeff2e116f38f56bdbff098c20d4c06677dca4e633
parent4b2fac04ed6fc007a86d43bdb0586ca363ec94c2
iio: adc: ad7606_spi: fix reg write value mask

commit 89944d88f8795c6c89b9514cb365998145511cd4 upstream.

Fix incorrect value mask for register write. Register values are 8-bit,
not 9. If this function was called with a value > 0xFF and an even addr,
it would cause writing to the next register.

Fixes: f2a22e1e172f ("iio: adc: ad7606: Add support for software mode for ad7616")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Angelo Dureghello <adureghello@baylibre.com>
Link: https://patch.msgid.link/20250428-iio-adc-ad7606_spi-fix-write-value-mask-v1-1-a2d5e85a809f@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ad7606_spi.c