]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: frequency: ad9523: use dev_err_probe
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 13 Mar 2026 11:57:44 +0000 (13:57 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2026 21:12:24 +0000 (21:12 +0000)
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: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/frequency/ad9523.c

index f4e80ea0c6d29d430bd9ef7b80dd6bf716baf1c2..ea4d2763564a339f9cb44ba214a34488b43514bc 100644 (file)
@@ -955,10 +955,8 @@ static int ad9523_probe(struct spi_device *spi)
        int ret;
 
        pdata = dev_get_platdata(dev);
-       if (!pdata) {
-               dev_err(&spi->dev, "no platform data?\n");
-               return -EINVAL;
-       }
+       if (!pdata)
+               return dev_err_probe(dev, -EINVAL, "no platform data?\n");
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
        if (indio_dev == NULL)