[U-Boot] [PATCH] gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation

Axel Lin axel.lin at ingics.com
Sat Jun 15 11:10:38 CEST 2013


The implementation of gpio_is_valid() has inversed logic, fix it.

Signed-off-by: Axel Lin <axel.lin at ingics.com>
---
Hi,
I don't have this hardware to test, but current code looks obviously wrong.
I'd appreciate if someone can review and test this patch.

Axel
 drivers/gpio/altera_pio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c
index fb03760..7ab6df8 100644
--- a/drivers/gpio/altera_pio.c
+++ b/drivers/gpio/altera_pio.c
@@ -294,6 +294,6 @@ int gpio_is_valid(int number)
 	int gidx = altera_pio_gidx(number);
 
 	if (gidx < 0)
-		return 1;
-	return 0;
+		return 0;
+	return 1;
 }
-- 
1.8.1.2





More information about the U-Boot mailing list