iio: adc: ad9467: add mutex to struct ad9467_state
authorNuno Sa <nuno.sa@analog.com>
Thu, 7 Dec 2023 12:39:26 +0000 (13:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:52 +0000 (15:35 -0800)
commita98f6c657c607399a46c663b7fb1983c644b2b51
tree7583bbd7738499c89b37bd8249b1a49726c6f36b
parent0c7b8f88315916de2719c0bfbb8e7fd8c68254d6
iio: adc: ad9467: add mutex to struct ad9467_state

[ Upstream commit 737720197be445bb9eec2986101e4a386e019337 ]

When calling ad9467_set_scale(), multiple calls to ad9467_spi_write()
are done which means we need to properly protect the whole operation so
we are sure we will be in a sane state if two concurrent calls occur.

Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-3-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/adc/ad9467.c