Skip to content

Commit

Permalink
pinctrl: pistachio: fix use of irq_of_parse_and_map()
Browse files Browse the repository at this point in the history
[ Upstream commit 0c9843a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Lv Ruyi authored and gregkh committed May 9, 2022
1 parent 111827d commit cdc350a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pinctrl/pinctrl-pistachio.c
Expand Up @@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
}

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

Expand Down

0 comments on commit cdc350a

Please sign in to comment.