]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ad7124: use AD7124_MAX_CHANNELS
authorDavid Lechner <dlechner@baylibre.com>
Wed, 17 Sep 2025 14:17:23 +0000 (09:17 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 13 Oct 2025 07:37:23 +0000 (08:37 +0100)
Use AD7124_MAX_CHANNELS macro instead of hardcoding 16 in
ad7124_disable_all(). We already have the macro, so we should use it.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7124.c

index 950abdb75e6d48e006d7ddb8ba4f9bb60c445960..b13a7824ae014f2acffe70e7c0d02cf572caf369 100644 (file)
@@ -708,7 +708,7 @@ static int ad7124_disable_all(struct ad_sigma_delta *sd)
        int ret;
        int i;
 
-       for (i = 0; i < 16; i++) {
+       for (i = 0; i < AD7124_MAX_CHANNELS; i++) {
                ret = ad7124_disable_one(sd, i);
                if (ret < 0)
                        return ret;