Re: [PATCH 05/15] iio: adc: check the result of ad_sd_init()
From: Jonathan Cameron
Date: Sat Oct 31 2026 - 22:24:12 EST
On Wed, 28 Oct 2026 09:40:03 +0000
Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:
> On Tue, Oct 27, 2026 at 05:19:09PM +0100, Greg Kroah-Hartman wrote:
> > From: Josef Bacik <josef@xxxxxxxxxxxxxx>
> >
> > ad_sd_init() asks for the optional "rdy" GPIO and returns the error if
> > that fails, for instance -EPROBE_DEFER. The binding of the AD7780
> > describes such a GPIO.
> >
> > ad7780, ad7791, ad7793 and max11205 ignore the result. The function has
> > then returned before it set the driver data of the IIO device, which
> > devm_ad_sd_setup_buffer_and_trigger() dereferences a few lines further
> > down in these probe functions, and sigma_delta->rdy_gpiod holds an
> > ERR_PTR() which ad_sigma_delta_clear_pending_event() takes for a GPIO.
> >
> > Return the error, as the other users of the library do.
> >
> > Fixes: a87ef09b1fdf ("iio: adc: ad_sigma_delta: Add support for reading irq status using a GPIO")
> > Cc: stable <stable@xxxxxxxxxx>
> > Cc: "Nuno Sá" <nuno.sa@xxxxxxxxxx>
> > Cc: Michael Hennerich <Michael.Hennerich@xxxxxxxxxx>
> > Cc: Renato Lui Geh <renatogeh@xxxxxxxxx>
> > Cc: David Lechner <dlechner@xxxxxxxxxxxx>
> > Cc: Andy Shevchenko <andy@xxxxxxxxxx>
> > Cc: Ramona Bolboaca <ramona.bolboaca@xxxxxxxxxx>
> > Cc: "Uwe Kleine-König" <u.kleine-koenig@xxxxxxxxxxxx>
> > Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > ---
>
> Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
Applied to the fixes-togreg branch of iio.git
thanks,
J