Re: [PATCH] iio: adc: ti-adc12138: fail init on calibration timeout
From: Andy Shevchenko
Date: Mon Jun 15 2026 - 09:55:09 EST
On Mon, Jun 15, 2026 at 04:39:13PM +0530, Prashant Rahul wrote:
> adc12138_init() starts device calibration and waits for the EOC
> interrupt before checking the calibration status. The wait helper
> returns -ETIMEDOUT if the interrupt does not arrive in time, but the
> init path ignores the error and continues probing the device. This could
> lead to registering the device even tho it may not be properly
> initialized.
>
> Return the wait error so probe fails cleanly when calibration does not
> complete.
...
> + ret = adc12138_wait_eoc(adc, msecs_to_jiffies(100));
> + if (ret) {
> + dev_warn(&adc->spi->dev, "wait eoc timeout\n");
> + return ret;
return dev_warn_probe(...);
> + }
--
With Best Regards,
Andy Shevchenko