Skip to content

Commit 30fee1d

Browse files
Yuuoniybrgl
authored andcommitted
gpio: idt3243x: Fix IRQ check in idt_gpio_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: 4195926 ("gpio: Add support for IDT 79RC3243x GPIO controller") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 0b39536 commit 30fee1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-idt3243x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ static int idt_gpio_probe(struct platform_device *pdev)
164164
return PTR_ERR(ctrl->pic);
165165

166166
parent_irq = platform_get_irq(pdev, 0);
167-
if (!parent_irq)
168-
return -EINVAL;
167+
if (parent_irq < 0)
168+
return parent_irq;
169169

170170
girq = &ctrl->gc.irq;
171171
girq->chip = &idt_gpio_irqchip;

0 commit comments

Comments
 (0)