]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: nuvoton: npcm8xx: Fix error handling in npcm8xx_gpio_fw()
authorYue Haibing <yuehaibing@huawei.com>
Sat, 18 Jan 2025 03:13:34 +0000 (11:13 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 16 Feb 2025 23:16:01 +0000 (00:16 +0100)
fwnode_irq_get() was changed to not return 0, fix this by checking
for negative error, also update the error log.

Fixes: acf4884a5717 ("pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver")
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/20250118031334.243324-1-yuehaibing@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c

index 471f644c5eef2c87aeec50d3eca07bbe3663edd5..70e6966049e47c1b603849ce23acbe9854217bd4 100644 (file)
@@ -2361,8 +2361,8 @@ static int npcm8xx_gpio_fw(struct npcm8xx_pinctrl *pctrl)
                        return dev_err_probe(dev, ret, "gpio-ranges fail for GPIO bank %u\n", id);
 
                ret = fwnode_irq_get(child, 0);
-               if (!ret)
-                       return dev_err_probe(dev, ret, "No IRQ for GPIO bank %u\n", id);
+               if (ret < 0)
+                       return dev_err_probe(dev, ret, "Failed to retrieve IRQ for bank %u\n", id);
 
                pctrl->gpio_bank[id].irq = ret;
                pctrl->gpio_bank[id].irq_chip = npcmgpio_irqchip;