Commit d6c6fd77 authored by Yue Haibing's avatar Yue Haibing Committed by Linus Walleij
Browse files

pinctrl: nuvoton: npcm8xx: Fix error handling in npcm8xx_gpio_fw()



fwnode_irq_get() was changed to not return 0, fix this by checking
for negative error, also update the error log.

Fixes: acf4884a ("pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver")
Signed-off-by: default avatarYue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/20250118031334.243324-1-yuehaibing@huawei.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 75b45627
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;