diff options
author | Nuno Sa <nuno.sa@analog.com> | 2024-07-02 18:02:50 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-07-29 21:31:09 +0200 |
commit | f3184b2f2c72839514763ca761663ad38c84751d (patch) | |
tree | cf4964c073c0c0950dcdc961ed3c72d80f8e2f6f | |
parent | iio: adc: ad_sigma_delta: use new '.masklength' accessors (diff) | |
download | linux-f3184b2f2c72839514763ca761663ad38c84751d.tar.xz linux-f3184b2f2c72839514763ca761663ad38c84751d.zip |
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 <nuno.sa@analog.com>
Reviewed-by: Alexandru Ardelean <aardelean@baylibre.com>
Link: https://patch.msgid.link/20240702-dev-iio-masklength-private-v1-18-98193bf536a6@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/adc/at91_adc.c | 4 |
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++; |