Re: [bug report] iio: adc: Add support for ad4062
From: Jonathan Cameron
Date: Sun Mar 01 2026 - 07:34:46 EST
On Fri, 6 Feb 2026 16:07:36 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Fri, Feb 06, 2026 at 04:40:31PM +0300, Dan Carpenter wrote:
> > [ Smatch checking is paused while we raise funding. #SadFace
> > https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
>
> Oh, this is indeed sad. Wondering if LF can donate...
>
> > Commit d5284402d28f ("iio: adc: Add support for ad4062") from Dec 17,
> > 2025 (linux-next), leads to the following Smatch static checker
> > warning:
> >
> > drivers/iio/adc/ad4062.c:1557 ad4062_probe()
> > warn: passing positive error code 's32min-(-1),1-3' to 'dev_err_probe'
>
> > 1555 ret = ad4062_request_ibi(i3cdev);
> > 1556 if (ret)
>
> if (ret < 0)
>
> resolves immediate isssue, but...
>
> > --> 1557 return dev_err_probe(dev, ret, "Failed to request i3c ibi\n");
> >
> > The comments for ad4062_request_ibi() say it returns negative error codes
> > but the comments for i3c_master_enec_locked() say it returns "a positive
> > I3C error code if the error is one of the official Mx error codes, and
> > a negative error code otherwise."
>
> ...would be nice to have a conversion helper to get Linux error codes
> from the Mx ones.
>
@Jorge, can you take a look at this please and ideally send a fix.
Thanks,
Jonathan