Skip to content

Commit 0c9843a

Browse files
Lv RuyiLinus Walleij
authored andcommitted
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: cefc03e ("pinctrl: Add Pistachio SoC pin control driver") Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Link: https://lore.kernel.org/r/20220424031430.3170759-1-lv.ruyi@zte.com.cn Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 05d8af4 commit 0c9843a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/pinctrl/pinctrl-pistachio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
13741374
}
13751375

13761376
irq = irq_of_parse_and_map(child, 0);
1377-
if (irq < 0) {
1378-
dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
1377+
if (!irq) {
1378+
dev_err(pctl->dev, "No IRQ for bank %u\n", i);
13791379
of_node_put(child);
1380-
ret = irq;
1380+
ret = -EINVAL;
13811381
goto err;
13821382
}
13831383

0 commit comments

Comments
 (0)