[PATCH 09/13] iio: adc: ad7791: use dev_err_probe

Antoniu Miclaus posted 13 patches 6 days, 21 hours ago
[PATCH 09/13] iio: adc: ad7791: use dev_err_probe
Posted by Antoniu Miclaus 6 days, 21 hours 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>
---
 drivers/iio/adc/ad7791.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ad7791.c b/drivers/iio/adc/ad7791.c
index ab1ab0d88492..bcdc19e799aa 100644
--- a/drivers/iio/adc/ad7791.c
+++ b/drivers/iio/adc/ad7791.c
@@ -413,10 +413,8 @@ static int ad7791_probe(struct spi_device *spi)
 	struct ad7791_state *st;
 	int ret;
 
-	if (!spi->irq) {
-		dev_err(&spi->dev, "Missing IRQ.\n");
-		return -ENXIO;
-	}
+	if (!spi->irq)
+		return dev_err_probe(dev, -ENXIO, "Missing IRQ.\n");
 
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
 	if (!indio_dev)
-- 
2.43.0