Re: [PATCH v2] iio: adc: ti-ads124s08: Return reset GPIO lookup errors
From: Jonathan Cameron
Date: Wed Jul 01 2026 - 17:39:49 EST
On Thu, 25 Jun 2026 09:47:33 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> 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.)
>
Applied to the fixes-togreg branch of iio.git.
One small process thing. Please don't send new versions in reply to older
ones - just send a new thread. Doing it as replies makes for confusing threads
and ensures they are many pages up in the maintainers inbox!
Jonathan