summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2024-01-08 21:06:44 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-01-23 23:06:56 +0100
commite7748c17bda04758a01f1241896b553f8b3873cc (patch)
tree6de384db9920e718b7881e129aaa4f3994263a3f
parentMAINTAINERS: correct file entry for AD7091R (diff)
downloadlinux-e7748c17bda04758a01f1241896b553f8b3873cc.tar.xz
linux-e7748c17bda04758a01f1241896b553f8b3873cc.zip
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>
-rw-r--r--drivers/iio/industrialio-core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 9a85752124dd..e8551a1636ba 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -213,9 +213,7 @@ bool iio_buffer_enabled(struct iio_dev *indio_dev)
{
struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
- return iio_dev_opaque->currentmode &
- (INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE |
- INDIO_BUFFER_TRIGGERED);
+ return iio_dev_opaque->currentmode & INDIO_ALL_BUFFER_MODES;
}
EXPORT_SYMBOL_GPL(iio_buffer_enabled);