]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: adc: ad7768-1: use dev_err_probe()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 30 Mar 2026 11:18:54 +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/ad7768-1.c

index 73fb734d06b2336abc9d021d68fa6e5acb4e45db..598936e47fd2d02cc881c86772ab33c40058d450 100644 (file)
@@ -1871,10 +1871,8 @@ static int ad7768_probe(struct spi_device *spi)
                return ret;
 
        ret = ad7768_setup(indio_dev);
-       if (ret < 0) {
-               dev_err(&spi->dev, "AD7768 setup failed\n");
-               return ret;
-       }
+       if (ret < 0)
+               return dev_err_probe(dev, ret, "AD7768 setup failed\n");
 
        init_completion(&st->completion);
        ret = devm_mutex_init(&spi->dev, &st->pga_lock);