iio: adc: ti-ads1015: Use guard(mutex) and factor out code for INFO_RAW
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Mar 2025 16:58:16 +0000 (16:58 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 22 Apr 2025 18:09:55 +0000 (19:09 +0100)
commit5655ba5ada999d08ff3e0c75e3c3ca9b0cd97ed2
treec44f62f4cd42435179846d8d4d1731ac6d057100
parent3ba3800286bb8881d323659fd019cf6b746580d9
iio: adc: ti-ads1015: Use guard(mutex) and factor out code for INFO_RAW

By use of automatic lock release and introducing a new utility
function to handle the core activity of reading the ADC channel,
many more complex code flows can be replaced by direct returns.

Cc: Marek Vasut <marex@denx.de>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250309165819.1346684-6-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads1015.c