From: Jonathan Cameron <jic23@kernel.org>
To: Joshua Crofts <crofts@kernel.org>
Cc: "Vaibhav Chahar" <vaibhav.chahar26@gmail.com>,
"Marius Cristea" <marius.cristea@microchip.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: adc: palmas_gpadc: Use guard(mutex) to manage locks
Date: Sat, 28 Nov 2026 04:02:41 +0000 [thread overview]
Message-ID: <20261128040241.00305137@jic23-hlaptop> (raw)
In-Reply-To: <0a01f11c-86d3-437d-977f-dd5978542b86@kernel.org>
On Thu, 26 Nov 2026 14:26:21 +0100
> > static int palmas_gpadc_write_event_value(struct iio_dev *indio_dev,
> > @@ -739,19 +725,18 @@ static int palmas_gpadc_write_event_value(struct iio_dev *indio_dev,
> > {
> > struct palmas_gpadc *adc = iio_priv(indio_dev);
> > int adc_chan = chan->channel;
> > - int old;
> > - int ret;
> >
> > if (adc_chan >= PALMAS_ADC_CH_MAX || type != IIO_EV_TYPE_THRESH)
> > return -EINVAL;
> >
> > - mutex_lock(&adc->lock);
> > + guard(mutex)(&adc->lock);
> > +
> > switch (info) {
> > - case IIO_EV_INFO_VALUE:
> > - if (val < 0 || val > 0xFFF) {
> > - ret = -EINVAL;
> > - goto out_unlock;
> > - }
> > + case IIO_EV_INFO_VALUE: {
> > + int old;
> > +
> > + if (val < 0 || val > 0xFFF)
> > + return -EINVAL;
>
> Not introduced by this patch (I sound like Sashiko :) ), but -ERANGE is preferred.
>
> This could be tweaked whilst applying though.
Backlog too large for this sort of thing today.
So will leave it for now.
Series applied to the testing branch of iio.git.
Thanks,
Jonathan
>
next prev parent reply other threads:[~2026-11-28 4:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 11:44 [PATCH v4 0/2] iio: adc: " Vaibhav Chahar
2026-11-26 11:44 ` [PATCH v4 1/2] iio: adc: mcp3564: Use guard() to manage mutex Vaibhav Chahar
2026-11-26 11:44 ` [PATCH v4 2/2] iio: adc: palmas_gpadc: Use guard(mutex) to manage locks Vaibhav Chahar
2026-11-26 13:26 ` Joshua Crofts
2026-11-28 4:02 ` Jonathan Cameron [this message]
2026-11-26 13:26 ` [PATCH v4 0/2] iio: adc: " Joshua Crofts
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=20261128040241.00305137@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=crofts@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marius.cristea@microchip.com \
--cc=nuno.sa@analog.com \
--cc=vaibhav.chahar26@gmail.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®