iio: stm32-dac: Replace indio_dev->mlock with own device lock
authorSergiu Cuciurean <sergiu.cuciurean@analog.com>
Wed, 16 Sep 2020 09:23:49 +0000 (12:23 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 16 Sep 2020 17:51:40 +0000 (18:51 +0100)
commit2544ea7bd075948dcb0bdebfae739eb235c69728
tree1663e5de288a9d4b0d88cb9f3350a459f9ec2bf5
parentd3e0e14d65178d73ee0f991934c5fa89737e3922
iio: stm32-dac: 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. The lock protects against potential races when
reading the CR reg and then updating, so that the state of pm_runtime
is consistent between the two operations.

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>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/20200916092349.75647-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/stm32-dac.c