summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoniu Miclaus <antoniu.miclaus@analog.com>2026-03-13 13:57:44 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-03-21 21:12:24 +0000
commit6849c6356bc314f40328d67f8a8fc8e207b28c29 (patch)
tree6982df1ebae148633c3f966e9db44f313ce503f1
parent9582a65eda4f566df9dc329e70f8be48260a9c9d (diff)
iio: frequency: ad9523: use dev_err_probe
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>
-rw-r--r--drivers/iio/frequency/ad9523.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
index f4e80ea0c6d2..ea4d2763564a 100644
--- a/drivers/iio/frequency/ad9523.c
+++ b/drivers/iio/frequency/ad9523.c
@@ -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)