提交 f04aa386 编写于 作者: L Lv Ruyi 提交者: Zheng Zengkai

pinctrl: pistachio: fix use of irq_of_parse_and_map()

stable inclusion
from stable-v5.10.114
commit fb172e93f861cd46477a41de3b4b773f687fb5a0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5IY1V

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fb172e93f861cd46477a41de3b4b773f687fb5a0

--------------------------------

[ Upstream commit 0c9843a7 ]

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: cefc03e5 ("pinctrl: Add Pistachio SoC pin control driver")
Reported-by: NZeal Robot <zealci@zte.com.cn>
Signed-off-by: NLv Ruyi <lv.ruyi@zte.com.cn>
Link: https://lore.kernel.org/r/20220424031430.3170759-1-lv.ruyi@zte.com.cnSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 f9644af0
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册