From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linus Walleij <linusw@kernel.org>, Bartosz Golaszewski <brgl@kernel.org>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>,
Thomas Richard <thomas.richard@bootlin.com>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: [PATCH 3/7] gpio: da9055: normalize return value of gpio_get
Date: Wed, 18 Feb 2026 11:06:52 -0800 [thread overview]
Message-ID: <20260218190657.2974723-3-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20260218190657.2974723-1-dmitry.torokhov@gmail.com>
The GPIO get callback is expected to return 0 or 1 (or a negative error
code). Ensure that the value returned by da9055_gpio_get() is normalized
to the [0, 1] range.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/gpio/gpio-da9055.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index a09bd6eb93cf..1949a6ea8ec6 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -55,7 +55,7 @@ static int da9055_gpio_get(struct gpio_chip *gc, unsigned offset)
return ret;
}
- return ret & (1 << offset);
+ return !!(ret & (1 << offset));
}
--
2.53.0.335.g19a08e0c02-goog
next prev parent reply other threads:[~2026-02-18 19:07 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 ` Dmitry Torokhov [this message]
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
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=20260218190657.2974723-3-dmitry.torokhov@gmail.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