Skip to content
Commit 59fcc6af authored by Miquel Raynal's avatar Miquel Raynal Committed by Jonathan Cameron
Browse files

iio: adc: max1027: Prevent single channel accesses during buffer reads



When hardware buffers are enabled (the cnvst pin being the trigger), one
should not mess with the device state by requesting a single channel
read.

There is already a iio_buffer_enabled() check in *_read_single_value()
to merely prevent this situation but the check is inconsistent since
buffers can be enabled after the if clause anyway. Instead, use the core
mutex by calling iio_device_claim/release_direct_mode().

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20210921115408.66711-11-miquel.raynal@bootlin.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent af8b93e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment