diff options
Diffstat (limited to 'drivers/staging/iio/accel/adis16240_ring.c')
-rw-r--r-- | drivers/staging/iio/accel/adis16240_ring.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/iio/accel/adis16240_ring.c b/drivers/staging/iio/accel/adis16240_ring.c index aa215b9..9a3dba2 100644 --- a/drivers/staging/iio/accel/adis16240_ring.c +++ b/drivers/staging/iio/accel/adis16240_ring.c @@ -69,9 +69,10 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p) return -ENOMEM; } - if (ring->scan_count && + if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && adis16240_read_ring_data(&indio_dev->dev, st->rx) >= 0) - for (; i < ring->scan_count; i++) + for (; i < bitmap_weight(indio_dev->active_scan_mask, + indio_dev->masklength); i++) data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2])); /* Guaranteed to be aligned with 8 byte boundary */ |