summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iio/buffer/kfifo_buf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iio/buffer/kfifo_buf.c b/drivers/iio/buffer/kfifo_buf.c
index 34289ce12f20..4ecfa0ec3016 100644
--- a/drivers/iio/buffer/kfifo_buf.c
+++ b/drivers/iio/buffer/kfifo_buf.c
@@ -225,9 +225,6 @@ int devm_iio_kfifo_buffer_setup(struct device *dev,
{
struct iio_buffer *buffer;
- if (mode_flags)
- mode_flags &= kfifo_access_funcs.modes;
-
if (!mode_flags)
return -EINVAL;
@@ -235,6 +232,8 @@ int devm_iio_kfifo_buffer_setup(struct device *dev,
if (!buffer)
return -ENOMEM;
+ mode_flags &= kfifo_access_funcs.modes;
+
indio_dev->modes |= mode_flags;
indio_dev->setup_ops = setup_ops;