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

Dan Carpenter
2026-02-06T13:40:36Z

[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]

Hello Jorge Marques,

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'

drivers/iio/adc/ad4062.c
1547 pm_runtime_set_active(dev);
1548 ret = devm_pm_runtime_enable(dev);
1549 if (ret)
1550 return dev_err_probe(dev, ret, "Failed to enable pm_runtime\n");
1551
1552 pm_runtime_set_autosuspend_delay(dev, 1000);
1553 pm_runtime_use_autosuspend(dev);
1554
1555 ret = ad4062_request_ibi(i3cdev);
1556 if (ret)
--> 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."

1558
1559 ret = ad4062_gpio_init(st);
1560 if (ret)
1561 return ret;
1562
1563 ret = devm_work_autocancel(dev, &st->trig_conv, ad4062_trigger_work);
1564 if (ret)
1565 return ret;
1566
1567 return devm_iio_device_register(dev, indio_dev);
1568 }

regards,
dan carpenter