mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 11/14] gpio: move gpio_is_valid to include/gpio.h
Date: Fri, 28 Nov 2014 15:29:03 +0100	[thread overview]
Message-ID: <1417184946-16128-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1417184946-16128-1-git-send-email-s.hauer@pengutronix.de>

No architectue implements its own gpio_is_valid() function, so move
the only existing implementation to include/gpio.h where it's available
for all users.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/asm-generic/gpio.h | 11 -----------
 include/gpio.h             | 11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 95fdd05..7674970 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -1,17 +1,6 @@
 #ifndef __ASM_GENERIC_GPIO_H
 #define __ASM_GENERIC_GPIO_H
 
-#define ARCH_NR_GPIOS 256
-
-static inline int gpio_is_valid(int gpio)
-{
-	if (gpio < 0)
-		return 0;
-	if (gpio < ARCH_NR_GPIOS)
-		return 1;
-	return 0;
-}
-
 void gpio_set_value(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
diff --git a/include/gpio.h b/include/gpio.h
index 4a97521..f116ea6 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -3,6 +3,17 @@
 
 #include <asm/gpio.h>
 
+#define ARCH_NR_GPIOS 256
+
+static inline int gpio_is_valid(int gpio)
+{
+	if (gpio < 0)
+		return 0;
+	if (gpio < ARCH_NR_GPIOS)
+		return 1;
+	return 0;
+}
+
 #define GPIOF_DIR_OUT	(0 << 0)
 #define GPIOF_DIR_IN	(1 << 0)
 
-- 
2.1.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-11-28 14:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 14:28 [PATCH 01/14] ARM: friendlyarm-mini2440: fix compilation for some displays Sascha Hauer
2014-11-28 14:28 ` [PATCH 02/14] ARM: ep93xx: Fix typo Sascha Hauer
2014-11-28 14:28 ` [PATCH 03/14] ARM: ep93xx: let broken SoCs depend on BROKEN Sascha Hauer
2014-11-28 14:28 ` [PATCH 04/14] ARM: Let MMU depend on !CPU_ARM946E Sascha Hauer
2014-11-28 14:28 ` [PATCH 05/14] ARM: AT91: Always provide clk_set_rate stub Sascha Hauer
2014-11-28 15:23   ` Lucas Stach
2014-11-30 11:01     ` Sascha Hauer
2014-11-28 14:28 ` [PATCH 06/14] mci: mxs-mci: add f_min/f_max fields unconditionally Sascha Hauer
2014-11-28 14:28 ` [PATCH 07/14] param: make string arguments to dev_add_param_fixed const Sascha Hauer
2014-11-28 14:29 ` [PATCH 08/14] fs: bpkfs: select CRC32 Sascha Hauer
2014-11-28 14:29 ` [PATCH 09/14] firmware: altera serial: depend on GENERIC_GPIO Sascha Hauer
2014-11-28 14:29 ` [PATCH 10/14] spi: mxs-spi: Allow compilation on i.MX28 only Sascha Hauer
2014-11-28 14:29 ` Sascha Hauer [this message]
2014-11-28 14:29 ` [PATCH 12/14] ARM: rockchip: select PINCTRL Sascha Hauer
2014-11-28 14:29 ` [PATCH 13/14] ARM: AM335x: Select OFTREE Sascha Hauer
2014-11-28 14:29 ` [PATCH 14/14] Kconfig: make BROKEN invisible Sascha Hauer
2014-12-01  9:00   ` Michael Olbrich
2014-12-01 11:12     ` 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=1417184946-16128-11-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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