]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:18 +0000 (14:39 +0200)
[ Upstream commit d6c6fd77e5816e3f6689a2767cdd777797506f24 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c

index d09a5e9b2eca538caed8aab132f14c55892c1621..17825bbe142135ce4fb804b5d509d927ff0676e9 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;