Re: [PATCH v2 1/2] iio: adc: ti-ads112c14: add burnout current support
From: Andy Shevchenko
Date: Tue Sep 01 2026 - 02:56:36 EST
On Mon, Aug 31, 2026 at 04:14:47PM -0500, David Lechner wrote:
> On 8/28/26 2:38 AM, Andy Shevchenko wrote:
> > On Thu, Aug 27, 2026 at 05:27:02PM -0500, David Lechner (TI) wrote:
...
> >> + return dev_err_probe(dev, -EINVAL,
> >
> > I would use different error code, EINVAL is abused and overloaded a lot in the
> > kernel, and basically errors like ENODEV and EINVAL are synonyms to "*an* error"
> > happened. Unfortunately, reading the errno*.h I haven't found anything better.
>
> There is an error message to disambiguate.
> >
> >> + "invalid burn-out-current-nanoamp value\n");
While this is true, there might be the case when it won't help. When the kernel
is compiled without printk() support and run in production the userspace still
may decode an error from the number representation. That's why in a tricky cases
(this one probably not that tricky, but just saying) it's very important to use
better granularity for the error codes.
--
With Best Regards,
Andy Shevchenko