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: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20210921115408.66711-11-miquel.raynal@bootlin.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
Please register or sign in to comment