From patchwork Sat Jun 11 17:33:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 1825 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.47.109) by localhost6.localdomain6 with IMAP4-SSL; 14 Jun 2011 16:45:42 -0000 Delivered-To: patches@linaro.org Received: by 10.52.181.10 with SMTP id ds10cs375584vdc; Sat, 11 Jun 2011 10:24:23 -0700 (PDT) Received: by 10.43.54.193 with SMTP id vv1mr4364694icb.338.1307813062607; Sat, 11 Jun 2011 10:24:22 -0700 (PDT) Received: from mail-pw0-f50.google.com (mail-pw0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id g12si10745235ibn.69.2011.06.11.10.24.22 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Jun 2011 10:24:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by pwi3 with SMTP id 3so1860707pwi.37 for ; Sat, 11 Jun 2011 10:24:21 -0700 (PDT) Received: by 10.142.43.6 with SMTP id q6mr528757wfq.421.1307813061157; Sat, 11 Jun 2011 10:24:21 -0700 (PDT) Received: from localhost.localdomain ([114.216.151.112]) by mx.google.com with ESMTPS id k4sm3255010pbl.75.2011.06.11.10.24.11 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Jun 2011 10:24:19 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Cc: Grant Likely , kernel@pengutronix.de, patches@linaro.org, Shawn Guo Subject: [PATCH] gpio/mxc: fix a bug with gpio_get_value calling Date: Sun, 12 Jun 2011 01:33:29 +0800 Message-Id: <1307813609-27758-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 When calling gpio_get_value, the gpio number other than bit offset should be passed as the argument. Signed-off-by: Shawn Guo --- 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);