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)
committerJonathan Cameron <jic23@kernel.org>
Wed, 5 Nov 2014 18:33:47 +0000 (18:33 +0000)
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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/meter/ade7758_ring.c

index 628e902dd81515d7d403879aadde6a260246aef7..6e90064907427596e8a5ee0d00c12ea046635874 100644 (file)
@@ -87,7 +87,7 @@ static int ade7758_ring_preenable(struct iio_dev *indio_dev)
 {
        unsigned channel;
 
-       if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
+       if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
                return -EINVAL;
 
        channel = find_first_bit(indio_dev->active_scan_mask,