iio: adc: fsl-imx25-gcq: Replace indio_dev->mlock with own device lock
authorSergiu Cuciurean <sergiu.cuciurean@analog.com>
Wed, 16 Sep 2020 09:29:28 +0000 (12:29 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 21 Sep 2020 17:41:35 +0000 (18:41 +0100)
commit8a0f412fca6e55765ad04c67037eb3907f0ad076
treeab53fd143e9b984061e4013163c94d58c2be0988
parent3cef2e31b54b5975f45dfd7f88204bb78b03d535
iio: adc: fsl-imx25-gcq: Replace indio_dev->mlock with own device lock

As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock, to protect against any other accesses during the
reading of sample. Reading a sample requires multiple consecutive regmap
operations and a completion callback, so this requires that no other
read occurs until it completes.

This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916092928.78026-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/fsl-imx25-gcq.c