Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0915750e authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Greg Kroah-Hartman
Browse files

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: f7a388d6 ("power: reset: Add a driver for the Gemini poweroff")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent dc1ea1df
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -107,8 +107,8 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
		return PTR_ERR(gpw->base);

	irq = platform_get_irq(pdev, 0);
	if (!irq)
		return -EINVAL;
	if (irq < 0)
		return irq;

	gpw->dev = dev;