mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
[ Upstream commitba18dad0fb] 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:f7a388d6cd("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>
This commit is contained in:
parent
da71a1483b
commit
43f2fe2a69
|
|
@ -107,8 +107,8 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(gpw->base);
|
return PTR_ERR(gpw->base);
|
||||||
|
|
||||||
irq = platform_get_irq(pdev, 0);
|
irq = platform_get_irq(pdev, 0);
|
||||||
if (!irq)
|
if (irq < 0)
|
||||||
return -EINVAL;
|
return irq;
|
||||||
|
|
||||||
gpw->dev = dev;
|
gpw->dev = dev;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user