mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/4] gpiolib: use signed int for gpio in gpiod_set_value
Date: Mon,  9 Jan 2023 16:58:34 +0100	[thread overview]
Message-ID: <20230109155836.2220277-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230109155836.2220277-1-a.fatoum@pengutronix.de>

barebox gpio identifiers are always in the range of non-negative
signed integers with negative values reserved for errors.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/gpiod.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/gpiod.h b/include/gpiod.h
index 32180337dc2d..cc3fb966a010 100644
--- a/include/gpiod.h
+++ b/include/gpiod.h
@@ -23,7 +23,7 @@ enum gpiod_flags {
 /* returned gpio descriptor can be passed to any normal gpio_* function */
 int gpiod_get(struct device *dev, const char *_con_id, enum gpiod_flags flags);
 
-static inline void gpiod_set_value(unsigned gpio, bool value)
+static inline void gpiod_set_value(int gpio, bool value)
 {
 	if (gpio != -ENOENT)
 		gpio_direction_active(gpio, value);
-- 
2.30.2




  reply	other threads:[~2023-01-09 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 15:58 [PATCH 1/4] of: gpio: include <of.h> in <of_gpio.h> Ahmad Fatoum
2023-01-09 15:58 ` Ahmad Fatoum [this message]
2023-01-09 15:58 ` [PATCH 3/4] gpiolib: implement dev_gpiod_get_index Ahmad Fatoum
2023-01-09 15:58 ` [PATCH 4/4] gpiolib: implement gpiod_get_value Ahmad Fatoum
2023-01-10 14:53 ` [PATCH 1/4] of: gpio: include <of.h> in <of_gpio.h> Sascha Hauer

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=20230109155836.2220277-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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