Skip to contentSkip to conversation

gpio/mxc: fix a bug with gpio_get_value calling

PATCH New Shawn Guo 2 participants 2 messages Jun 11, 2011 – Jun 12, 2011

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 gpio/mxc: fix a bug with gpio_get_value calling

When calling gpio_get_value, the gpio number other than bit offset should be passed as the argument.

---
Grant, Sascha,

This is an important bug fix. Currently, if any driver request any gpio not on port 1 for IRQ_TYPE_EDGE_BOTH, we run into kernel oops. So please apply the patch asap. Thanks.

 drivers/gpio/gpio-mxc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpio/gpio-mxc.c +1 -1
index 950e53a..2f6a81b 100644
@@ -83,7 +83,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 		edge = GPIO_INT_FALL_EDGE;
 		break;
 	case IRQ_TYPE_EDGE_BOTH:
-		val = gpio_get_value(gpio & 31);
+		val = gpio_get_value(gpio);
 		if (val) {
 			edge = GPIO_INT_LOW_LEV;
 			pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
Signature · 1 line
1.7.4.1
Applied
#1 lore raw

PATCH 1/1 gpio/mxc: fix a bug with gpio_get_value calling

Quoted 4 lines · Shawn Guo

When calling gpio_get_value, the gpio number other than bit offset should be passed as the argument.

Applied, thanks.

g.

Quoted 26 lines

---
Grant, Sascha,

This is an important bug fix. Currently, if any driver request any gpio not on port 1 for IRQ_TYPE_EDGE_BOTH, we run into kernel oops. So please apply the patch asap. Thanks.

 drivers/gpio/gpio-mxc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpio/gpio-mxc.c +1 -1
index 950e53a..2f6a81b 100644
@@ -83,7 +83,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 		edge = GPIO_INT_FALL_EDGE;
 		break;
 	case IRQ_TYPE_EDGE_BOTH:
-		val = gpio_get_value(gpio & 31);
+		val = gpio_get_value(gpio);
 		if (val) {
 			edge = GPIO_INT_LOW_LEV;
 			pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
Signature · 1 line
1.7.4.1