Skip to content

Commit

Permalink
power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
Browse files Browse the repository at this point in the history
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: f7a388d ("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>
  • Loading branch information
Miaoqian Lin authored and Sebastian Reichel committed Feb 1, 2022
1 parent 2b7950c commit ba18dad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/power/reset/gemini-poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ba18dad

Please sign in to comment.