From patchwork Tue Feb 16 15:40:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102768 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1738160lbl; Tue, 16 Feb 2016 07:42:24 -0800 (PST) X-Received: by 10.66.102.65 with SMTP id fm1mr31978147pab.36.1455637344788; Tue, 16 Feb 2016 07:42:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m70si51902836pfj.147.2016.02.16.07.42.24; Tue, 16 Feb 2016 07:42:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755347AbcBPPmU (ORCPT + 30 others); Tue, 16 Feb 2016 10:42:20 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:64216 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932791AbcBPPmA (ORCPT ); Tue, 16 Feb 2016 10:42:00 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0Lvfyq-1ZvXbL3W6W-017XtC; Tue, 16 Feb 2016 16:41:32 +0100 From: Arnd Bergmann To: Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Russell King , Bjorn Helgaas , Alexandre Courbot , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Ralf Baechle , 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 Message-Id: <1455637261-2920972-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455637261-2920972-1-git-send-email-arnd@arndb.de> References: <455637086-2794174-1-git-send-email-arnd@arndb.de> <1455637261-2920972-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:e9I4n9sy6PyfgfkQLus4LmFKwzxjGnLahn87Oh+4EEz/dEqZzmI LtnORHyhCGaFgmUaH5Ihrjgy7613+uzJecPpIVM2X+Xx8EcpoO9BD5nEgbnXW4tr0ewq7UK m5WTq6i2c2QuL9MfeyxJgpViae6H/T7kxu9Yu45wrUbtMwByfdIyIBjULFfEfyEVxlW4VXf DiYm2g/2zC+4bpKMDAVMg== X-UI-Out-Filterresults: notjunk:1; V01:K0:t6Cj3QeaQKw=:I+oXVxtRdcp0uPYz95qpLK G5wlMx5OOjmurCFCNs8JulEdslbXS6tP+F8HYlbpf9c2B8v7vHJvBDyz8rm3TMzEfufqtR63T 25d+E3pDQYFchwhhdxtgfSZBG7klAZLQawXA9l39z0WUTwpRWtBTOyMyx3zlpZEXKbALutpGP Mw22GxLl6ZEXVP6YW0oZGGnGYuMTEYzVjdZBr7UCExWmvtVyJMOZDMO4psfHcRCackMtWz7rZ B08HEXwKfH4n83Hnjtft/zjqR3nzekQO96+0UEks/qqznwF8rASWSDI0uLDMEcqcZHLCpgpZD kbTkZgnNnGX4wpaK8oq3ZO+tC7uYHOdr7OUrsVdsnebR+WSyrQ9nSZp0S4mhTDMwUebEbvPYr 2aWELeMj/dTrVCxaPRYFey48jJfJLdW531WHbGfwJIRcvwC8ukL7e7rZTKqTCl2Twtld+/mE6 eR3y3Rfy41YxwCGxdbJnjekPuJXF92sfRRhsI0CWil4YW+LqoFWuQGoStsrqlPfmMgbAKSRq5 jF/cwF+46TJABq72sMAoDidh0kk2tJZ2stCCSnwCrEEwysAwUDPBC0ldPQl+Ug01JNMiBhinS e6K8gmcLcmv5iQ8Z6ZKVBTwnIKMNuuBtiTKTeI1g8nZQDz2Ea8pkrSKAOPxMikAC5p7QFqeOI Mm+/hGhfN9B4ibsir0HPgBCCKP6MqzsBVcpI+SR34bWDoqQC2r3pt1NCqxdx1O1pVn9M= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/asm-generic/gpio.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.0 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