From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Waqar Hameed" <waqar.hameed@axis.com>,
chuguangqing <chuguangqing@inspur.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: light: ltr501: return proper error code from ltr501_get_gain_index()
Date: Sat, 7 Feb 2026 15:54:00 +0000 [thread overview]
Message-ID: <20260207155400.049906f0@jic23-huawei> (raw)
In-Reply-To: <aYGxa1E9WnYLXlet@smile.fi.intel.com>
On Tue, 3 Feb 2026 10:27:23 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Mon, Feb 02, 2026 at 02:07:12PM +0200, Antoniu Miclaus wrote:
> > Return -EINVAL instead of -1 when no matching gain value is found
> > in the gain table. Update the callers to propagate this error directly
> > rather than overwriting it with -EINVAL.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>
> ...
>
> > static int ltr501_get_gain_index(const struct ltr501_gain *gain, int size,
>
> > if (val == gain[i].scale && val2 == gain[i].uscale)
> > return i;
> >
> > - return -1;
> > + return -EINVAL;
>
> I would use -ENOENT, but I'm not sure if there is any ABI involved (id est we
> return this to user space).
It will surface. Not sure anyone would notice the change, but lets
keep things simple.
Applied.
Jonathan
>
> > }
>
>
prev parent reply other threads:[~2026-02-07 15:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 12:07 Antoniu Miclaus
2026-02-02 12:25 ` Waqar Hameed
2026-02-03 8:27 ` Andy Shevchenko
2026-02-07 15:54 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260207155400.049906f0@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=chuguangqing@inspur.com \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=waqar.hameed@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®