]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: nxp-sar-adc: use field_get() for EOC bit check
authorPiyush Patle <piyushpatle228@gmail.com>
Fri, 10 Apr 2026 21:41:25 +0000 (03:11 +0530)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:22 +0000 (09:58 +0100)
Use field_get() here now that runtime-mask support exists, and drop
the obsolete TODO. Since NXP_SAR_ADC_EOC_CH(c) is BIT(c), the
resulting !-test is semantically identical.

No functional change.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Acked-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/nxp-sar-adc.c

index 9d9f2c76bed4fd156ab91c2f17451721bd02c9b2..8340c041e7bc36e0ecd44dcac0487f1b546f069c 100644 (file)
@@ -317,11 +317,7 @@ static int nxp_sar_adc_read_data(struct nxp_sar_adc *info, unsigned int chan)
 
        ceocfr = readl(NXP_SAR_ADC_CEOCFR0(info->regs));
 
-       /*
-        * FIELD_GET() can not be used here because EOC_CH is not constant.
-        * TODO: Switch to field_get() when it will be available.
-        */
-       if (!(NXP_SAR_ADC_EOC_CH(chan) & ceocfr))
+       if (!field_get(NXP_SAR_ADC_EOC_CH(chan), ceocfr))
                return -EIO;
 
        cdr = readl(NXP_SAR_ADC_CDR(info->regs, chan));