From: Lars-Peter Clausen Date: Tue, 4 Nov 2014 17:03:15 +0000 (+0100) Subject: staging:iio:ade7758: Fix check if channels are enabled in prenable X-Git-Tag: firefly_0821_release~176^2~2506^2~4^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=79fa64eb2ee8ccb4bcad7f54caa2699730b10b22;p=firefly-linux-kernel-4.4.55.git staging:iio:ade7758: Fix check if channels are enabled in prenable 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 Cc: Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c index 628e902dd815..6e9006490742 100644 --- a/drivers/staging/iio/meter/ade7758_ring.c +++ b/drivers/staging/iio/meter/ade7758_ring.c @@ -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,