ARM: Fix INVALID value to avoid -1 array index
Chao Xu [Thu, 9 May 2013 18:17:25 +0000 (11:17 -0700)]
Merge fixup.

Change-Id: I1d2eb6fdb912470f023768988a74727ce3757918
Signed-off-by: Chao Xu <cxu@nvidia.com>
Reviewed-on: http://git-master/r/229414
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com>

arch/arm/mach-tegra/pinmux-t12-tables.c

index 2b8e073..c685b3a 100644 (file)
@@ -521,10 +521,14 @@ const struct tegra_pingroup_desc tegra_soc_pingroups[TEGRA_MAX_PINGROUP] = {
 
 #undef PINGROUP
 
+/* HACK to workaround -1 index (for INVALID index) */
+#undef TEGRA_GPIO_INVALID
+#define TEGRA_GPIO_INVALID     TEGRA_MAX_GPIO
+
 #define PINGROUP(pg_name, gpio_nr, vdd, f0, f1, f2, f3, fs, iod, reg)  \
        [TEGRA_GPIO_##gpio_nr] =  TEGRA_PINGROUP_ ##pg_name\
 
-const int gpio_to_pingroup[TEGRA_MAX_GPIO] = {
+const int gpio_to_pingroup[TEGRA_MAX_GPIO + 1] = {
        PINGROUPS
 
 };