Commit 0c9843a7 authored by Lv Ruyi's avatar Lv Ruyi Committed by Linus Walleij

pinctrl: pistachio: fix use of irq_of_parse_and_map()

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: cefc03e5 ("pinctrl: Add Pistachio SoC pin control driver")
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarLv Ruyi <lv.ruyi@zte.com.cn>
Link: https://lore.kernel.org/r/20220424031430.3170759-1-lv.ruyi@zte.com.cnSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 05d8af44
...@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) ...@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
} }
irq = irq_of_parse_and_map(child, 0); irq = irq_of_parse_and_map(child, 0);
if (irq < 0) { if (!irq) {
dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); dev_err(pctl->dev, "No IRQ for bank %u\n", i);
of_node_put(child); of_node_put(child);
ret = irq; ret = -EINVAL;
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment