]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: hx711: make use of iio_for_each_active_channel()
authorNuno Sa <nuno.sa@analog.com>
Thu, 18 Jul 2024 13:37:49 +0000 (15:37 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Aug 2024 09:13:39 +0000 (10:13 +0100)
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>
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-3-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/hx711.c

index b3372ccff7d5e865a50cc52529d01d7a2388ac26..376f4e02de9724658f6511dabfa46f3c1f7f7c2c 100644 (file)
@@ -363,10 +363,7 @@ static irqreturn_t hx711_trigger(int irq, void *p)
 
        memset(hx711_data->buffer, 0, sizeof(hx711_data->buffer));
 
-       for (i = 0; i < indio_dev->masklength; i++) {
-               if (!test_bit(i, indio_dev->active_scan_mask))
-                       continue;
-
+       iio_for_each_active_channel(indio_dev, i) {
                hx711_data->buffer[j] = hx711_reset_read(hx711_data,
                                        indio_dev->channels[i].channel);
                j++;