Skip to content

Commit ba18dad

Browse files
Yuuoniysre
authored andcommitted
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: 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>
1 parent 2b7950c commit ba18dad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/power/reset/gemini-poweroff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
107107
return PTR_ERR(gpw->base);
108108

109109
irq = platform_get_irq(pdev, 0);
110-
if (!irq)
111-
return -EINVAL;
110+
if (irq < 0)
111+
return irq;
112112

113113
gpw->dev = dev;
114114

0 commit comments

Comments
 (0)