[PATCH v2 4/4] iio: frequency: ad9523: use dev_err_probe

Antoniu Miclaus posted 4 patches 3 weeks, 3 days ago
[PATCH v2 4/4] iio: frequency: ad9523: use dev_err_probe
Posted by Antoniu Miclaus 3 weeks, 3 days ago
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>
---
Changes in v2:
  - No changes

 drivers/iio/frequency/ad9523.c | 6 ++----
 1 file 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)
-- 
2.43.0
Re: [PATCH v2 4/4] iio: frequency: ad9523: use dev_err_probe
Posted by Andy Shevchenko 3 weeks, 3 days ago
On Fri, Mar 13, 2026 at 01:57:44PM +0200, Antoniu Miclaus wrote:
> Use dev_err_probe() instead of dev_err() in the probe path to ensure
> proper handling of deferred probing and to simplify error handling.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko