
From: Stephen Warren swarren@nvidia.com
TEGRA_PORTS_PER_BANK and TEGRA_GPIO_PORTS represent the same thing. TEGRA_GPIO_PORTS is more widely used, so replace all usage with that, and remove the redundant definition.
Signed-off-by: Stephen Warren swarren@nvidia.com --- arch/arm/include/asm/arch-tegra/gpio.h | 1 - drivers/gpio/tegra_gpio.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/include/asm/arch-tegra/gpio.h b/arch/arm/include/asm/arch-tegra/gpio.h index 363d16c486d1..07921f34b9d7 100644 --- a/arch/arm/include/asm/arch-tegra/gpio.h +++ b/arch/arm/include/asm/arch-tegra/gpio.h @@ -9,7 +9,6 @@ #define _TEGRA_GPIO_H_
#define TEGRA_GPIOS_PER_PORT 8 -#define TEGRA_PORTS_PER_BANK 4
#define GPIO_BANK(x) ((x) >> 5) #define GPIO_PORT(x) (((x) >> 3) & 0x3) diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c index 5a031159ca37..9abab13daaa9 100644 --- a/drivers/gpio/tegra_gpio.c +++ b/drivers/gpio/tegra_gpio.c @@ -1,6 +1,6 @@ /* * NVIDIA Tegra20 GPIO handling. - * (C) Copyright 2010-2012,2015 + * (C) Copyright 2010-2016 * NVIDIA Corporation <www.nvidia.com> * * SPDX-License-Identifier: GPL-2.0+ @@ -346,7 +346,7 @@ static int gpio_tegra_bind(struct udevice *parent) for (bank = 0; bank < bank_count; bank++) { int port;
- for (port = 0; port < TEGRA_PORTS_PER_BANK; port++) { + for (port = 0; port < TEGRA_GPIO_PORTS; port++) { struct tegra_gpio_platdata *plat; struct udevice *dev; int base_port; @@ -355,7 +355,7 @@ static int gpio_tegra_bind(struct udevice *parent) if (!plat) return -ENOMEM; plat->bank = &ctlr->gpio_bank[bank]; - base_port = bank * TEGRA_PORTS_PER_BANK + port; + base_port = bank * TEGRA_GPIO_PORTS + port; plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port; plat->port_name = gpio_port_name(base_port);