]> git.hungrycats.org Git - linux/commitdiff
staging:iio:ade7758: Fix check if channels are enabled in prenable
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 4 Nov 2014 17:03:15 +0000 (18:03 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 13 Nov 2014 18:02:42 +0000 (19:02 +0100)
commit 79fa64eb2ee8ccb4bcad7f54caa2699730b10b22 upstream.

We should check if a channel is enabled, not if no channels are enabled.

Fixes: 550268ca1111 ("staging:iio: scrap scan_count and ensure all drivers use active_scan_mask")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/staging/iio/meter/ade7758_ring.c

index 6590944a6678602e69cc9a9b73f71428324eb6d8..46eb15d25d4b952ab989b46c98b0fe4f54a4eb27 100644 (file)
@@ -92,7 +92,7 @@ static int ade7758_ring_preenable(struct iio_dev *indio_dev)
        unsigned channel;
        int ret;
 
-       if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
+       if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
                return -EINVAL;
 
        ret = iio_sw_buffer_preenable(indio_dev);