summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/ltc2497.h
diff options
context:
space:
mode:
authorNuno Sá <nuno.sa@analog.com>2022-10-04 16:48:58 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-11-23 22:43:58 +0300
commitda8091f8acfa953ac55e2aa8d4218e49b18206a7 (patch)
treedab80be4195a5c18874507fe38b3a33fb439c08b /drivers/iio/adc/ltc2497.h
parent98c4fb93d1d448db191eea795a40072dc61da07d (diff)
downloadlinux-da8091f8acfa953ac55e2aa8d4218e49b18206a7.tar.xz
iio: adc: ltc2947-core: do not use internal iio_dev lock
The iio_device lock is only meant for internal use. Hence define a device local lock to protect against concurrent accesses. While at it, properly include "mutex.h" for mutex related APIs. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20221004134909.1692021-6-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/ltc2497.h')
-rw-r--r--drivers/iio/adc/ltc2497.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/adc/ltc2497.h b/drivers/iio/adc/ltc2497.h
index e023de0d88c4..781519b52475 100644
--- a/drivers/iio/adc/ltc2497.h
+++ b/drivers/iio/adc/ltc2497.h
@@ -12,6 +12,8 @@ struct ltc2497_chip_info {
struct ltc2497core_driverdata {
struct regulator *ref;
ktime_t time_prev;
+ /* lock to protect against multiple access to the device */
+ struct mutex lock;
const struct ltc2497_chip_info *chip_info;
u8 addr_prev;
int (*result_and_measure)(struct ltc2497core_driverdata *ddata,