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:
c517d83
)
gpio: mb86s70: Return error if requesting an already assigned gpio
author
Axel Lin
<axel.lin@ingics.com>
Fri, 30 Jan 2015 10:26:25 +0000
(18:26 +0800)
committer
Linus Walleij
<linus.walleij@linaro.org>
Mon, 2 Mar 2015 14:35:41 +0000
(15:35 +0100)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mb86s7x.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-mb86s7x.c
b/drivers/gpio/gpio-mb86s7x.c
index 21b1ce5abdfe1306c4b0a71e07a07ccca7faee51..ee93c0ab0a597d8d41a0d86c26d2b1ac34ac0e6b 100644
(file)
--- a/
drivers/gpio/gpio-mb86s7x.c
+++ b/
drivers/gpio/gpio-mb86s7x.c
@@
-58,6
+58,11
@@
static int mb86s70_gpio_request(struct gpio_chip *gc, unsigned gpio)
spin_lock_irqsave(&gchip->lock, flags);
val = readl(gchip->base + PFR(gpio));
+ if (!(val & OFFSET(gpio))) {
+ spin_unlock_irqrestore(&gchip->lock, flags);
+ return -EINVAL;
+ }
+
val &= ~OFFSET(gpio);
writel(val, gchip->base + PFR(gpio));