]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ad7292: use dev_err_probe()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 30 Mar 2026 11:18:50 +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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7292.c

index 64d40b053582d1a07667a69ccaf4d53a99234e4f..e5ad83d2240ae617a56949d1df33398facdad685 100644 (file)
@@ -267,10 +267,9 @@ static int ad7292_probe(struct spi_device *spi)
        st->spi = spi;
 
        ret = ad7292_spi_reg_read(st, AD7292_REG_VENDOR_ID);
-       if (ret != ADI_VENDOR_ID) {
-               dev_err(&spi->dev, "Wrong vendor id 0x%x\n", ret);
-               return -EINVAL;
-       }
+       if (ret != ADI_VENDOR_ID)
+               return dev_err_probe(dev, -EINVAL,
+                                    "Wrong vendor id 0x%x\n", ret);
 
        ret = devm_regulator_get_enable_read_voltage(dev, "vref");
        if (ret < 0 && ret != -ENODEV)