Re: [PATCH] iio: adc: ti-ads124s08: Return reset failures

From: Andy Shevchenko

Date: Wed Jun 24 2026 - 07:10:36 EST


On Wed, Jun 24, 2026 at 01:53:25PM +0800, Pengpeng Hou wrote:
> devm_gpiod_get_optional() returns NULL when the optional GPIO is absent,
> but returns an ERR_PTR when the provider lookup fails. Probe currently
> logs the ERR_PTR case and keeps the error pointer in reset_gpio.
>
> Later ads124s_reset() treats any non-NULL reset_gpio as valid and passes
> it to gpiod_set_value_cansleep(). Return the lookup error instead of
> retaining the ERR_PTR.
>
> Also return ads124s_reset() failures so probe does not register the IIO
> device after either the GPIO reset path or the software reset command
> failed.

Not sure about the latter, but the GPIO case should mention deferral probe and
hence it needs a Fixes tag.

--
With Best Regards,
Andy Shevchenko