Skip to contentSkip to conversation

gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation

PATCH New Axel Lin 2 participants 3 messages Jun 15, 2013 – Aug 5, 2013 GPIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation

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

---
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(-)
drivers/gpio/altera_pio.c +2 -2
index fb03760..7ab6df8 100644
@@ -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;
 }
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation

Hi Axel,

Quoted 11 lines · Axel Lin

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

---
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(-)

Not sure why this was assigned to me, as this is not ARM related. Delegating to Thomas Chou as the NIOS(II) custodian and Cc:ing him, as well as Scott McNutt, nios2-generic maintainer.

drivers/gpio/altera_pio.c int gpio_is_valid(int number) · line 299

Quoted 13 lines
drivers/gpio/altera_pio.c +2 -2
index fb03760..7ab6df8 100644
@@ -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;
 }

Amicalement,

Signature · 1 line
Albert.
author
#2 lore raw

PATCH 1/1 gpio: altera_pio: Fix inversed logic of gpio_is_valid() implementation

2013/7/29 Albert ARIBAUD <[email protected]>:

Quoted 13 lines

Hi Axel,

Quoted 8 lines · Axel Lin

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

---
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.

Quoted 7 lines
Quoted 3 lines

Axel

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

Not sure why this was assigned to me, as this is not ARM related. Delegating to Thomas Chou as the NIOS(II) custodian and Cc:ing him, as well as Scott McNutt, nios2-generic maintainer.

I guess it is just because there is no response from both Thomas Chou and Scott McNutt. I have CCed them when submitted the patch.
Checking the maillist archive, seems no email from Thomas Chou and Scott McNutt in 2013. So I have no idea who will pick up this patch.

Regards,
Axel