summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2012-04-09 15:49:44 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-04-09 15:49:44 +0530
commitff733eae4ef57372a5170e0eddb42c4f9c5d25ae (patch)
treea70015bf961982c385348922544b62aa92467cf5 /drivers/gpio
parent7c5ac020871b88d57668b2d5f2738db099c8eca1 (diff)
gpio: tegra: use tegra_gpio_bank_count instead of ARRAY_SIZE
Change-Id: Ife96f261f8f0ce3f85f0f7bf13bdb1a1f3268e1b Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-tegra.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index c743c87db155..0146db6436a1 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -95,11 +95,7 @@ struct tegra_gpio_bank {
static struct irq_domain *irq_domain;
static void __iomem *regs;
static u32 tegra_gpio_bank_count;
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-static struct tegra_gpio_bank tegra_gpio_banks[7];
-#else
-static struct tegra_gpio_bank tegra_gpio_banks[8];
-#endif
+static struct tegra_gpio_bank *tegra_gpio_banks;
static inline void tegra_gpio_writel(u32 val, u32 reg)
{
@@ -499,7 +495,7 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev)
return -ENODEV;
}
- for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) {
+ for (i = 0; i < tegra_gpio_bank_count; i++) {
for (j = 0; j < 4; j++) {
int gpio = tegra_gpio_compose(i, j, 0);
tegra_gpio_writel(0x00, GPIO_INT_ENB(gpio));
@@ -585,7 +581,7 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
int j;
seq_printf(s, "Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL\n");
- for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) {
+ for (i = 0; i < tegra_gpio_bank_count; i++) {
for (j = 0; j < 4; j++) {
int gpio = tegra_gpio_compose(i, j, 0);
seq_printf(s,