Skip to contentSkip to conversation

arm: ep93xx: Don't try to release not acquired GPIO lines

PATCH New Rafal Prylowski 3 participants 3 messages Apr 5, 2012 – Apr 11, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: ep93xx: Don't try to release not acquired GPIO lines

Fail path of ep93xx_keypad_acquire_gpio() tries to release GPIO lines not acquired successfully before. Fix this.

Cc H Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>

---
Patch applies to v3.4rc1.

 arch/arm/mach-ep93xx/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-ep93xx/core.c +1 -1
Index: linux-2.6/arch/arm/mach-ep93xx/core.c
===================================================================
@@ -734,7 +734,7 @@ int ep93xx_keypad_acquire_gpio(struct pl
 fail_gpio_d:
 	gpio_free(EP93XX_GPIO_LINE_C(i));
 fail_gpio_c:
-	for ( ; i >= 0; --i) {
+	for (--i; i >= 0; --i) {
 		gpio_free(EP93XX_GPIO_LINE_C(i));
 		gpio_free(EP93XX_GPIO_LINE_D(i));
 	}
#1 lore raw

PATCH 1/1 arm: ep93xx: Don't try to release not acquired GPIO lines

Quoted 18 lines · Rafal Prylowski

Fail path of ep93xx_keypad_acquire_gpio() tries to release GPIO lines not acquired successfully before. Fix this.

Cc H Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>

---
Patch applies to v3.4rc1.

 arch/arm/mach-ep93xx/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/arm/mach-ep93xx/core.c
===================================================================

arch/arm/mach-ep93xx/core.c int ep93xx_keypad_acquire_gpio(struct pl · line 740

Quoted 8 lines
arch/arm/mach-ep93xx/core.c +1 -1
@@ -734,7 +734,7 @@ int ep93xx_keypad_acquire_gpio(struct pl
 fail_gpio_d:
 	gpio_free(EP93XX_GPIO_LINE_C(i));
 fail_gpio_c:
-	for ( ; i >= 0; --i) {
+	for (--i; i >= 0; --i) {
 		gpio_free(EP93XX_GPIO_LINE_C(i));
 		gpio_free(EP93XX_GPIO_LINE_D(i));
 	}

Thanks!

Applied
#2 lore raw

PATCH 1/1 arm: ep93xx: Don't try to release not acquired GPIO lines

Quoted 14 lines · H Hartley Sweeten
Quoted 13 lines · Rafal Prylowski

Fail path of ep93xx_keypad_acquire_gpio() tries to release GPIO lines not acquired successfully before. Fix this.

Cc H Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>

---
Patch applies to v3.4rc1.

 arch/arm/mach-ep93xx/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

arch/arm/mach-ep93xx/core.c int ep93xx_keypad_acquire_gpio(struct pl · line 740

Quoted 13 lines

Index: linux-2.6/arch/arm/mach-ep93xx/core.c
===================================================================

arch/arm/mach-ep93xx/core.c +1 -1
@@ -734,7 +734,7 @@ int ep93xx_keypad_acquire_gpio(struct pl
 fail_gpio_d:
 	gpio_free(EP93XX_GPIO_LINE_C(i));
 fail_gpio_c:
-	for ( ; i >= 0; --i) {
+	for (--i; i >= 0; --i) {
 		gpio_free(EP93XX_GPIO_LINE_C(i));
 		gpio_free(EP93XX_GPIO_LINE_D(i));
 	}

Applied to ep93xx-fixes on https://github.com/RyanMallon/linux-ep93xx

Thanks,
~Ryan