Re: [PATCH v2 4/5] iio: adc: ti-adc161s626: log buffer setup failure in probe
From: Jonathan Cameron
Date: Tue Jun 23 2026 - 15:37:12 EST
On Sat, 20 Jun 2026 23:10:56 +0530
Prashant Rahul <prashantrahul23@xxxxxxxxx> wrote:
> Errors are logged when enabling the regulator or adding the cleanup
> action fails, but not when buffer setup fails. Log the error returned by
> the buffer setup path as well.
Why this particular one but not the devm_iio_device_register() below it?
Both pretty much only fail on driver bugs. Or out of memory for
which dev_err_probe() doesn't print anything anyway (on basis that
is normally pretty noisy).
>
> Signed-off-by: Prashant Rahul <prashantrahul23@xxxxxxxxx>
> ---
> drivers/iio/adc/ti-adc161s626.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c
> index be1cc2e77862..f83073280c9c 100644
> --- a/drivers/iio/adc/ti-adc161s626.c
> +++ b/drivers/iio/adc/ti-adc161s626.c
> @@ -217,7 +217,7 @@ static int ti_adc_probe(struct spi_device *spi)
> ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,
> ti_adc_trigger_handler, NULL);
> if (ret)
> - return ret;
> + return dev_err_probe(&spi->dev, ret, "iio triggered buffer setup failed\n");
>
> return devm_iio_device_register(&spi->dev, indio_dev);
> }