projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f299920
)
mfd: sm501 fix gpio number calculation for upper bank
author
Ben Dooks
<
[email protected]
>
Fri, 25 Jul 2008 08:46:03 +0000
(
01:46
-0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 25 Jul 2008 17:53:30 +0000
(10:53 -0700)
The sm501_gpio_pin2nr() routine returns the wrong values for gpios in the
upper bank.
Signed-off-by: Ben Dooks <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/mfd/sm501.c
patch
|
blob
|
history
diff --git
a/drivers/mfd/sm501.c
b/drivers/mfd/sm501.c
index 79d7aea5510b41689dd503b31e66bbcc54708192..7aebad4c06ff939114bdff7f5f58874ee197f96d 100644
(file)
--- a/
drivers/mfd/sm501.c
+++ b/
drivers/mfd/sm501.c
@@
-1108,7
+1108,9
@@
static void sm501_gpio_remove(struct sm501_devdata *sm)
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)