From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
Arnd Bergmann <arnd@arndb.de>,
Russell King <rmk+kernel@arm.linux.org.uk>,
Bjorn Helgaas <bhelgaas@google.com>,
Alexandre Courbot <gnurou@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org, linux-arch@vger.kernel.org
Subject: [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig
Date: Tue, 16 Feb 2016 16:40:38 +0100 [thread overview]
Message-ID: <1455637261-2920972-5-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1455637261-2920972-1-git-send-email-arnd@arndb.de>
The ARM version of asm/gpio.h basically just contains the same definitions
as the gpiolib version, with the exception of ARCH_NR_GPIOS.
This adds the option for overriding the constant through Kconfig to
the architecture-independent header, so we can remove the ARM specific
file later.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/asm-generic/gpio.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 40ec1433f05d..8ca627dcea11 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -26,8 +26,12 @@
*/
#ifndef ARCH_NR_GPIOS
+#if defined(CONFIG_ARCH_NR_GPIO) && CONFIG_ARCH_NR_GPIO > 0
+#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
+#else
#define ARCH_NR_GPIOS 512
#endif
+#endif
/*
* "valid" GPIO numbers are nonnegative and may be passed to
--
2.7.0
next parent reply other threads:[~2016-02-16 15:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <455637086-2794174-1-git-send-email-arnd@arndb.de>
[not found] ` <1455637261-2920972-1-git-send-email-arnd@arndb.de>
2016-02-16 15:40 ` Arnd Bergmann [this message]
2016-02-16 15:40 ` [PATCH v2 5/5] gpio: allow setting ARCH_NR_GPIOS from Kconfig Arnd Bergmann
2016-02-18 23:23 ` Linus Walleij
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=1455637261-2920972-5-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=gnurou@gmail.com \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=rmk+kernel@arm.linux.org.uk \
/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