aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
318 struct u300_gpio_port *port = NULL; 318 struct u300_gpio_port *port = NULL;
319 struct list_head *p; 319 struct list_head *p;
320 int retirq; 320 int retirq;
321 bool found = false;
321 322
322 list_for_each(p, &gpio->port_list) { 323 list_for_each(p, &gpio->port_list) {
323 port = list_entry(p, struct u300_gpio_port, node); 324 port = list_entry(p, struct u300_gpio_port, node);
324 if (port->number == portno) 325 if (port->number == portno) {
326 found = true;
325 break; 327 break;
328 }
326 } 329 }
327 if (port == NULL) { 330 if (!found) {
328 dev_err(gpio->dev, "could not locate port for GPIO %d IRQ\n", 331 dev_err(gpio->dev, "could not locate port for GPIO %d IRQ\n",
329 offset); 332 offset);
330 return -EINVAL; 333 return -EINVAL;