diff options
author | Lv Ruyi <lv.ruyi@zte.com.cn> | 2022-04-24 03:14:30 +0000 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2022-04-24 16:24:09 +0200 |
commit | 0c9843a74a85224a89daa81fa66891dae2f930e1 (patch) | |
tree | dd96ae153b7da58306c55da1592c1a857e2ad08f /drivers | |
parent | 05d8af449d93e04547b4c6b328e39c890bc803f4 (diff) | |
download | linux-stable-0c9843a74a85224a89daa81fa66891dae2f930e1.tar.gz linux-stable-0c9843a74a85224a89daa81fa66891dae2f930e1.tar.bz2 linux-stable-0c9843a74a85224a89daa81fa66891dae2f930e1.zip |
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: cefc03e5995e ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pinctrl/pinctrl-pistachio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index 8d271c6b0ca4..5de691c630b4 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c @@ -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; } |