]> git.hungrycats.org Git - linux/commit
iio: adc: ad4000: fix reading unsigned data
authorDavid Lechner <dlechner@baylibre.com>
Wed, 30 Oct 2024 21:09:41 +0000 (16:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 13:02:37 +0000 (14:02 +0100)
commit7899bb1bbb77dcd3d9c81cb091e3d7694600b31a
tree01bd9cda1f5daeae2cd1e02e9a773551f27fd0f7
parent542c273e87772dd40e5cb5f9abb8d5a8a76b2669
iio: adc: ad4000: fix reading unsigned data

[ Upstream commit 62dd96ac9cdf2814f41cfc55ecaf22a28aad6ccb ]

Fix reading unsigned data from the AD4000 ADC via the _raw sysfs
attribute by ensuring that *val is set before returning from
ad4000_single_conversion(). This was not being set in any code path
and was causing the attribute to return a random value.

Fixes: 938fd562b974 ("iio: adc: Add support for AD4000")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241030-iio-adc-ad4000-fix-reading-unsigned-data-v1-1-2e28dd75fe29@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/adc/ad4000.c