Re: [bug report] iio: adc: Add support for ad4062

Andy Shevchenko
2026-02-06T14:07:40Z

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.

--
With Best Regards,
Andy Shevchenko