iio: adc: at91-sama5d2_adc: lock around at91_adc_read_info_raw()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 3 Aug 2022 10:28:51 +0000 (13:28 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 15 Aug 2022 21:29:58 +0000 (22:29 +0100)
commita0f96db4ca1279d2c5150ed306e32a589f66070b
tree2b432054bf962c5e6f2d87ea376a78a0804abab4
parent5f72666f4b1ac269fe5b3b3f0cfaa6ada6add57c
iio: adc: at91-sama5d2_adc: lock around at91_adc_read_info_raw()

Remove iio_device_{claim, release}_direct_mode() and lock/unlock to
&st->lock from at91_adc_read_info_raw(). Instead add a wrapper around
at91_adc_read_info_raw() and do there the lock/unlock. This will allow
using the at91_adc_read_info_raw() in patch that add support for
temperature sensor.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220803102855.2191070-16-claudiu.beznea@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c