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

Andy Shevchenko
2026-05-06T07:25:57Z

On Tue, May 05, 2026 at 05:17:23PM +0100, Jonathan Cameron wrote:
> On Tue, 5 May 2026 17:58:21 +0300
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Tue, May 05, 2026 at 02:26:40PM +0100, Jonathan Cameron wrote:

...

> > > > > > + 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).

--
With Best Regards,
Andy Shevchenko