Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>

authored by

Miaoqian Lin and committed by
Sebastian Reichel
ba18dad0 2b7950c7

+2 -2
+2 -2
drivers/power/reset/gemini-poweroff.c
··· 107 107 return PTR_ERR(gpw->base); 108 108 109 109 irq = platform_get_irq(pdev, 0); 110 - if (!irq) 111 - return -EINVAL; 110 + if (irq < 0) 111 + return irq; 112 112 113 113 gpw->dev = dev; 114 114