[PATCH v5 12/16] iio: adc: xilinx-xadc: Refine Zynq read/write error handling on timeout/interrupt

Andy Shevchenko andriy.shevchenko at intel.com
Tue Nov 24 09:24:05 PST 2026


On Tue, Nov 24, 2026 at 10:24:59PM +0530, Nagavarapu, Dileep Kumar wrote:
> On 11/10/2026 9:51 PM, Andy Shevchenko wrote:
> > On Tue, Nov 10, 2026 at 10:31:57AM +0530, Dileep Kumar Nagavarapu wrote:

...

> > >        ret = wait_for_completion_interruptible_timeout(&xadc->completion, HZ);
> > > -     if (ret == 0)
> > > -             ret = -EIO;
> > > -     else
> > > -             ret = 0;
> > > 
> > >        xadc_read_reg(xadc, XADC_ZYNQ_REG_DFIFO, &tmp);
> > > 
> > > -     return ret;
> > > +     if (ret == 0)
> > > +             return -ETIMEDOUT;
> > > +
> > > +     if (ret < 0)
> > > +             return ret;
> > 
> > First check for generic errors, then for exclusive conditions ( == 0).
> > 
> > > +     return 0;

...

> > >        ret = wait_for_completion_interruptible_timeout(&xadc->completion, HZ);
> > >        if (ret == 0)
> > > -             ret = -EIO;
> > > +             return -ETIMEDOUT;
> > > +
> > >        if (ret < 0)
> > >                return ret;
> > 
> > Ditto.
> 
> This patch does not fix any behavioural issue; it only changes the
> error codes.

Yes, it changes potential behaviour of the callers (which probably none) but my
comment is tighten to the code that is being changed.

> Sashiko suggested adding a Fixes tag. Is it OK to ignore this comment, or do
> you have any other suggestions?

If comment is okay to ignore it would mean the comment has no value. I don't
think so. Otherwise, please justify that.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list