[U-Boot] [PATCH 06/21] sunxi: gpio: Rename GPIOs to include a 'P' prefix

Hans de Goede hdegoede at redhat.com
Fri Apr 24 15:48:15 CEST 2015


From: Simon Glass <sjg at chromium.org>

By convention, sunxi GPIOs are named PA1, PA2 instead of A1, A2. Change
the driver model GPIO driver for sunxi to use these names.

Signed-off-by: Simon Glass <sjg at chromium.org>
Acked-by: Hans de Goede <hdegoede at redhat.com>
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 drivers/gpio/sunxi_gpio.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index cf5c624..29301c4 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -249,10 +249,11 @@ static char *gpio_bank_name(int bank)
 {
 	char *name;
 
-	name = malloc(2);
+	name = malloc(3);
 	if (name) {
-		name[0] = 'A' + bank;
-		name[1] = '\0';
+		name[0] = 'P';
+		name[1] = 'A' + bank;
+		name[2] = '\0';
 	}
 
 	return name;
-- 
2.3.5



More information about the U-Boot mailing list