Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: core: use INDIO_ALL_BUFFER_MODES in iio_buffer_enabled()

This replaces use of individual buffer mode flags with
INDIO_ALL_BUFFER_MODES in the iio_buffer_enabled() function.

This simplifies the code and makes it robust in case of the addition of
new buffer modes.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240108200647.3916681-1-dlechner@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
e7748c17 66b55916

+1 -3
+1 -3
drivers/iio/industrialio-core.c
··· 213 213 { 214 214 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 215 215 216 - return iio_dev_opaque->currentmode & 217 - (INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE | 218 - INDIO_BUFFER_TRIGGERED); 216 + return iio_dev_opaque->currentmode & INDIO_ALL_BUFFER_MODES; 219 217 } 220 218 EXPORT_SYMBOL_GPL(iio_buffer_enabled); 221 219