linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio/mxc: fix a bug with gpio_get_value calling
@ 2011-06-11 17:33 Shawn Guo
  2011-06-12  3:01 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Guo @ 2011-06-11 17:33 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
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(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 950e53a..2f6a81b 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -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);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-12  3:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-11 17:33 [PATCH] gpio/mxc: fix a bug with gpio_get_value calling Shawn Guo
2011-06-12  3:01 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).