Skip to content

Commit ec34a19

Browse files
committed
iio: dac: ad7303: Use iio helpers for masklength
Upstream has removed direct access to indio_dev->masklength. Replace the for_each_set_bit loop with the iio_for_each_active_channel() helper function and direct access to indio_dev->masklength with iio_get_masklength() to align with this change and to avoid warnings from the sparse checker. Signed-off-by: Nuno Sá <[email protected]>
1 parent 0c624ce commit ec34a19

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/iio/dac/ad7303.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ static irqreturn_t ad7303_trigger_handler(int irq, void *p)
7878
goto out;
7979

8080
j = 0;
81-
for_each_set_bit(i,
82-
indio_dev->active_scan_mask,
83-
indio_dev->masklength) {
81+
iio_for_each_active_channel(indio_dev, i) {
8482
st->dac_cache[i] = sample[j];
8583
val = AD7303_CMD_UPDATE_INPUT |
8684
(i << AD7303_CFG_ADDR_OFFSET) |
@@ -105,7 +103,7 @@ static int ad7303_update_scan_mode(struct iio_dev *indio_dev,
105103
struct ad7303_state *st = iio_priv(indio_dev);
106104
int i;
107105

108-
st->num_transfers = bitmap_weight(scan_mask, indio_dev->masklength);
106+
st->num_transfers = bitmap_weight(scan_mask, iio_get_masklength(indio_dev));
109107

110108
spi_message_init(&st->msg);
111109

0 commit comments

Comments
 (0)