pinctrl: nuvoton: Fix irq_of_parse_and_map() return value
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sat, 23 Apr 2022 09:41:42 +0000 (11:41 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 4 May 2022 21:48:40 +0000 (23:48 +0200)
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.

Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220423094142.33013-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c

index 3cf0f8a43c370890de4ee1ef841fa2fe3db4c194..cc085ba2d7e4651a302fa5effe87c8917b1028d8 100644 (file)
@@ -1898,9 +1898,9 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
                }
 
                ret = irq_of_parse_and_map(np, 0);
-               if (ret < 0) {
+               if (!ret) {
                        dev_err(dev, "No IRQ for GPIO bank %u\n", id);
-                       return ret;
+                       return -EINVAL;
                }
                pctrl->gpio_bank[id].irq = ret;
                pctrl->gpio_bank[id].irq_chip = npcmgpio_irqchip;