]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ad9467: use dev_err_probe()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 30 Mar 2026 11:18:55 +0000 (14:18 +0300)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:18 +0000 (09:58 +0100)
Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad9467.c

index 0bf67437508f7f1d12a4a2913b378f0c4c1302de..0c377f9a7f256c8703e3d36d82b49e9cface9441 100644 (file)
@@ -1349,11 +1349,10 @@ static int ad9467_probe(struct spi_device *spi)
                return ret;
 
        id = ad9467_spi_read(st, AN877_ADC_REG_CHIP_ID);
-       if (id != st->info->id) {
-               dev_err(dev, "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n",
-                       id, st->info->id);
-               return -ENODEV;
-       }
+       if (id != st->info->id)
+               return dev_err_probe(dev, -ENODEV,
+                                    "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n",
+                                    id, st->info->id);
 
        if (st->info->num_scales > 1)
                indio_dev->info = &ad9467_info;