提交 9dc12094 编写于 作者: M Miaoqian Lin 提交者: Zheng Zengkai

power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe

stable inclusion
from stable-v5.10.110
commit 43f2fe2a6995f835a51eabd3be1773d7fc6d7b8b
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

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

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

[ Upstream commit ba18dad0 ]

platform_get_irq() returns negative error number instead 0 on failure.
And the doc of platform_get_irq() provides a usage example:

    int irq = platform_get_irq(pdev, 0);
    if (irq < 0)
        return irq;

Fix the check of return value to catch errors correctly.

Fixes: f7a388d6 ("power: reset: Add a driver for the Gemini poweroff")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 4f078400
...@@ -107,8 +107,8 @@ static int gemini_poweroff_probe(struct platform_device *pdev) ...@@ -107,8 +107,8 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
return PTR_ERR(gpw->base); return PTR_ERR(gpw->base);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (!irq) if (irq < 0)
return -EINVAL; return irq;
gpw->dev = dev; gpw->dev = dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册