]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 20 Jan 2022 10:46:54 +0000 (10:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 12:14:47 +0000 (14:14 +0200)
commit0915750e67808dcae3a905ef80ac7007e117f230
treea9efd6f7d7c8b7770c98597a230c086b058309fb
parentdc1ea1dfffb3919b65e4a0bd01e367479db23ec2
power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe

[ Upstream commit ba18dad0fb880cd29aa97b6b75560ef14d1061ba ]

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: f7a388d6cd1c ("power: reset: Add a driver for the Gemini poweroff")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/reset/gemini-poweroff.c