aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Sa <[email protected]>2024-07-02 18:02:50 +0200
committerJonathan Cameron <[email protected]>2024-07-29 20:31:09 +0100
commitf3184b2f2c72839514763ca761663ad38c84751d (patch)
treecf4964c073c0c0950dcdc961ed3c72d80f8e2f6f
parentf726ebe7c23cd559869302212d638f468633e3b6 (diff)
iio: adc: at91_adc: make use of iio_for_each_active_channel()
Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Reviewed-by: Alexandru Ardelean <[email protected]> Link: https://patch.msgid.link/20240702-dev-iio-masklength-private-v1-18-98193bf536a6@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
-rw-r--r--drivers/iio/adc/at91_adc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index eb501e3c86a5..af4b0224076f 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -268,9 +268,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
struct iio_chan_spec const *chan;
int i, j = 0;
- for (i = 0; i < idev->masklength; i++) {
- if (!test_bit(i, idev->active_scan_mask))
- continue;
+ iio_for_each_active_channel(idev, i) {
chan = idev->channels + i;
st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, chan->channel));
j++;