Re: [PATCH v2] iio: adc: ti-ads124s08: Return reset GPIO lookup errors
From: Andy Shevchenko
Date: Thu Jun 25 2026 - 02:47:48 EST
On Thu, Jun 25, 2026 at 01:44:07PM +0800, Pengpeng Hou wrote:
> devm_gpiod_get_optional() returns NULL when the optional GPIO is absent,
> but returns an ERR_PTR when the GPIO provider lookup fails, including
> probe deferral.
>
> Probe currently logs the ERR_PTR case as if the reset GPIO were simply
> absent and keeps the error pointer in reset_gpio. Later ads124s_reset()
> treats any non-NULL reset_gpio as a valid descriptor and passes it to
> gpiod_set_value_cansleep().
The GPIOLIB code will print an error message each time that's called.
This might flood the logs with a noise.
> Return the lookup error instead of retaining the ERR_PTR.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
It's good as a fix for backport, but can you consider switching to use reset
framework and reset-gpio driver instead? (As a separate change on top of this
one.)
--
With Best Regards,
Andy Shevchenko