]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: adi-axi-adc: fix ad7606_bus_reg_read()
authorDavid Lechner <dlechner@baylibre.com>
Fri, 30 May 2025 21:50:14 +0000 (16:50 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 29 Jun 2025 16:15:39 +0000 (17:15 +0100)
commit6ac609d1fba19d5d40fb3c81201ffadcb6d00fb3
tree344f7b766c11cf466afc5cac143c5bdee255f42d
parent43d8c4a3a3c7caa7fcc01d1bb349920db7004266
iio: adc: adi-axi-adc: fix ad7606_bus_reg_read()

Mask the value read before returning it. The value read over the
parallel bus via the AXI ADC IP block contains both the address and
the data, but callers expect val to only contain the data.

axi_adc_raw_write() takes a u32 parameter, so addr was the wrong type.
This wasn't causing any issues but is corrected anyway since we are
touching the same line to add a new variable.

Cc: stable@vger.kernel.org
Fixes: 79c47485e438 ("iio: adc: adi-axi-adc: add support for AD7606 register writing")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250530-iio-adc-adi-axi-adc-fix-ad7606_bus_reg_read-v2-1-ad2dfc0694ce@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/adi-axi-adc.c