iio: adc: ad799x: do not use internal iio_dev lock
authorNuno Sá <nuno.sa@analog.com>
Tue, 4 Oct 2022 13:48:54 +0000 (15:48 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 23 Nov 2022 19:43:57 +0000 (19:43 +0000)
commit8f347c565df4e8dd2c862a48a3056bfe59d315e9
treef3941011f26d4502acdaac206944417343c0c3e4
parent3a258747a01f1f21fd4c10a07499bde684f8ca2a
iio: adc: ad799x: do not use internal iio_dev lock

'mlock' was being grabbed when setting the device frequency. In order to
not introduce any functional change a new lock is added. With that in
mind, the lock also needs to be grabbed in the places where 'mlock' is
since it was also being used to protect st->config against the current
device state.

On the other places the lock was being used, we can just drop
it since we are only doing one i2c bus read/write which is already
safe.

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-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad799x.c