summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-coh901.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-03-28 17:18:12 +0100
committerLinus Walleij <linus.walleij@linaro.org>2013-04-03 14:31:19 +0200
commit28d0c14b43a04deac8afe27ab700cc7638a7f4ba (patch)
tree74b5100ea1102035f7a6b655ebb4e5bdf850e9a7 /drivers/pinctrl/pinctrl-coh901.c
parentpinctrl: pinctrl_select_state: set the old_state back on error (diff)
downloadlinux-28d0c14b43a04deac8afe27ab700cc7638a7f4ba.tar.xz
linux-28d0c14b43a04deac8afe27ab700cc7638a7f4ba.zip
pinctrl: coh901: Fix error checking in u300_gpio_to_irq
The pointer "port" is always not NULL if gpio->port_list is not empty. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-coh901.c')
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index 86887850ac13..edde3acc4186 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -318,13 +318,16 @@ static int u300_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
struct u300_gpio_port *port = NULL;
struct list_head *p;
int retirq;
+ bool found = false;
list_for_each(p, &gpio->port_list) {
port = list_entry(p, struct u300_gpio_port, node);
- if (port->number == portno)
+ if (port->number == portno) {
+ found = true;
break;
+ }
}
- if (port == NULL) {
+ if (!found) {
dev_err(gpio->dev, "could not locate port for GPIO %d IRQ\n",
offset);
return -EINVAL;