iio: adc: ad7791: 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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Antoniu Miclaus 2026-03-30 14:18:52 +03:00 committed by Jonathan Cameron
parent d9e85469a7
commit db935b8cac

View File

@ -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)