iio: dac: ti-dac7612: Replace indio_dev->mlock with own device lock
authorSergiu Cuciurean <sergiu.cuciurean@analog.com>
Wed, 16 Sep 2020 09:25:35 +0000 (12:25 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 16 Sep 2020 17:56:22 +0000 (18:56 +0100)
commit20be66c193be1a758c507fe28e8f77ad407d5039
tree13a4b4d97803087ac877e96bd525cac955240ad3
parent2544ea7bd075948dcb0bdebfae739eb235c69728
iio: dac: ti-dac7612: 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 on the device's state from potential concurrent write
accesses from userspace. The write operation requires an SPI write, then
toggling of a GPIO, so the lock aims to protect the sanity of the entire
sequence of operation.

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/20200916092535.76527-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ti-dac7612.c