iio: core: Hide read accesses to iio_dev->currentmode
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Feb 2022 14:38:37 +0000 (15:38 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 10 Apr 2022 15:21:45 +0000 (16:21 +0100)
commit8c576f87ad7eb639b8bd4472a9bb830e0696dda5
tree3adaf18e206dd4aad53cd3566eae548c345fe8cf
parent2f53b4adfede66f1bc1c8bb7efd7ced2bad1191a
iio: core: Hide read accesses to iio_dev->currentmode

In order to later move this variable within the opaque structure, let's
create a helper for accessing it in read-only mode. This helper will be
exposed to device drivers and kept accessible for the few that could need
it. The write access to this variable however should be fully reserved to
the core so in a second step we will hide this variable into the opaque
structure.

Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20220207143840.707510-11-miquel.raynal@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bmc150-accel-core.c
drivers/iio/adc/at91-sama5d2_adc.c
drivers/iio/industrialio-core.c
include/linux/iio/iio.h