[U-Boot] [PATCH 12/60] gpio: tegra: remove duplicate define

Stephen Warren swarren at wwwdotorg.org
Tue Apr 19 22:58:52 CEST 2016


From: Stephen Warren <swarren at 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 at 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);
 
-- 
2.8.1



More information about the U-Boot mailing list