Skip to content

Commit 0b39536

Browse files
Yuuoniybrgl
authored andcommitted
gpio: mpc8xxx: Fix IRQ check in mpc8xxx_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: 76c47d1 ("gpio: mpc8xxx: Add ACPI support") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent df0cc57 commit 0b39536

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-mpc8xxx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ static int mpc8xxx_probe(struct platform_device *pdev)
388388
}
389389

390390
mpc8xxx_gc->irqn = platform_get_irq(pdev, 0);
391-
if (!mpc8xxx_gc->irqn)
392-
return 0;
391+
if (mpc8xxx_gc->irqn < 0)
392+
return mpc8xxx_gc->irqn;
393393

394394
mpc8xxx_gc->irq = irq_domain_create_linear(fwnode,
395395
MPC8XXX_GPIO_PINS,

0 commit comments

Comments
 (0)