RE: [PATCH v9 3/6] iio: adc: ad4691: add triggered buffer support

Sabau, Radu bogdan
2026-05-06T09:02:34Z

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@intel.com>
> Sent: Wednesday, May 6, 2026 10:26 AM

...

>
> > > > > > > + for (i = 0; i < ARRAY_SIZE(ad4691_gp_names); i++) {
> > > > > > > + irq = fwnode_irq_get_byname(dev_fwnode(dev),
> > > > > > > + ad4691_gp_names[i]);
> > > > > > > + if (irq > 0)
> > > > > > > + break;
> > > > > >
> > > > > > This is problematic in case the above returns EPROBE_DEFER. Can you
> confirm
> > > > > > it
> > > > > > may not ever happen? (Note, I don't know the answer.)
> > > > >
> > > > > You are right, thanks for this!
> > > > I'm missing something. Why is that a problem? Driver will return
> > > > the error and a dev_err_probe() is used so it won't print anything.
> > > > So probe will fail which is exactly what we want.
> > >
> > > If there are two IRQs and the first one is probe deferred and second returns
> > > an error, we return that error instead of the deferral probe.
> > >
> > > May be I missed something, but I have no idea how in this case it may
> return
> > > the first error code in such a case.
> > Ah. Indeed. I completely misread the code. if (irq) would do the job to fix
> this.
>
> Not really, as we are only concerned about deferred probe.
>
> if (irq > 0 || irq == -EPROBE_DEFER)
> break;
>
> will do the job. But again, please double check that the
> fwnode_irq_get_byname() is even capable of returning deferral probe
> (probably yes as my weak memory tells me).
>
> --
Hi everyone,

I checked and fwnode_irq_get_byname() can indeed return deferral probe
and the fix I had in mind is like the above.

Thank you all for looking into this,
Radu