From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Linus Walleij <linusw@kernel.org>,
Marek Vasut <marek.vasut+renesas@gmail.com>,
Thomas Richard <thomas.richard@bootlin.com>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 1/7] gpio: bd9571mwv: normalize return value of gpio_get
Date: Wed, 18 Feb 2026 13:02:47 -0800 [thread overview]
Message-ID: <aZYoZU0-Ttz8b1s4@google.com> (raw)
In-Reply-To: <CAMRc=MeZ9AmM4uMdFf=xkq+XuHxi7ObkZonihZmHnv3w3SdsFA@mail.gmail.com>
On Wed, Feb 18, 2026 at 09:23:38PM +0100, Bartosz Golaszewski wrote:
> On Wed, Feb 18, 2026 at 8:07 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > The GPIO get callback is expected to return 0 or 1 (or a negative error
> > code). Ensure that the value returned by bd9571mwv_gpio_get() is
> > normalized to the [0, 1] range.
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> > drivers/gpio/gpio-bd9571mwv.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-bd9571mwv.c
> > index 7c95bb36511e..cc5b1746f2fe 100644
> > --- a/drivers/gpio/gpio-bd9571mwv.c
> > +++ b/drivers/gpio/gpio-bd9571mwv.c
> > @@ -69,7 +69,7 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset)
> > if (ret < 0)
> > return ret;
> >
> > - return val & BIT(offset);
> > + return !!(val & BIT(offset));
> > }
> >
> > static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset,
> > --
> > 2.53.0.335.g19a08e0c02-goog
> >
>
> Thanks for doing this. I think it would make sense to backport them
> all the way to commit 86ef402d805d ("gpiolib: sanitize the return
> value of gpio_chip::get()")?
I do not think this is workable since the breakages are not limited to
dtivers/gpio/.
I would recommend reverting the patch for stable, but keeping it for 7.0
and working with maintainers outside of drivers/gpio to make sure the
fixes land in this release cycle.
This way you will ensure that new drivers are not adding tech debt while
not punishing existing users who might not be running latest and
greatest kernel.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2026-02-18 21:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 19:06 [PATCH 1/7] gpio: bd9571mwv: normalize return value of gpio_get Dmitry Torokhov
2026-02-18 19:06 ` [PATCH 2/7] gpio: cgbc: " Dmitry Torokhov
2026-02-18 19:06 ` [PATCH 3/7] gpio: da9055: " Dmitry Torokhov
2026-02-18 19:06 ` [PATCH 4/7] gpio: lp873x: " Dmitry Torokhov
2026-02-18 19:06 ` [PATCH 5/7] gpio: stp-xway: " Dmitry Torokhov
2026-02-18 19:06 ` [PATCH 6/7] gpio: tps65086: " Dmitry Torokhov
2026-02-18 19:06 ` [PATCH 7/7] gpio: viperboard: " Dmitry Torokhov
2026-02-18 20:23 ` [PATCH 1/7] gpio: bd9571mwv: " Bartosz Golaszewski
2026-02-18 21:02 ` Dmitry Torokhov [this message]
2026-02-19 8:57 ` Bartosz Golaszewski
2026-02-23 9:57 ` Bartosz Golaszewski
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=aZYoZU0-Ttz8b1s4@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=brgl@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.vasut+renesas@gmail.com \
--cc=thomas.richard@bootlin.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