From: Ben Dooks <ben-linux@fluff.org>
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Cc: Ben Dooks <ben-linux@fluff.org>
Subject: [patch 1/1] MFD: SM501 fix gpio number calculation for upper bank
Date: Wed, 02 Jul 2008 15:29:19 +0100 [thread overview]
Message-ID: <20080702142918.245723113@fluff.org> (raw)
In-Reply-To: 20080702142918.143669690@fluff.org
[-- Attachment #1: simtec/simtec-drivers-mfd-sm501-gpionrfix.patch --]
[-- Type: text/plain, Size: 865 bytes --]
The sm501_gpio_pin2nr() routine returns the wrong values
for gpios in the upper bank.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-rc8-quilt3/drivers/mfd/sm501.c
===================================================================
--- linux-2.6.26-rc8-quilt3.orig/drivers/mfd/sm501.c 2008-07-02 14:17:49.000000000 +0100
+++ linux-2.6.26-rc8-quilt3/drivers/mfd/sm501.c 2008-07-02 14:44:06.000000000 +0100
@@ -1108,7 +1108,9 @@ static void sm501_gpio_remove(struct sm5
static inline int sm501_gpio_pin2nr(struct sm501_devdata *sm, unsigned int pin)
{
struct sm501_gpio *gpio = &sm->gpio;
- return pin + (pin < 32) ? gpio->low.gpio.base : gpio->high.gpio.base;
+ int base = (pin < 32) ? gpio->low.gpio.base : gpio->high.gpio.base;
+
+ return (pin % 32) + base;
}
static inline int sm501_gpio_isregistered(struct sm501_devdata *sm)
--
parent reply other threads:[~2008-07-02 14:29 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20080702142918.143669690@fluff.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080702142918.245723113@fluff.org \
--to=ben-linux@fluff.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox