Skip to content

Commit 1d89e2a

Browse files
Sergey Shtylyovksacilotto
Sergey Shtylyov
authored andcommitted
ata: libahci_platform: fix IRQ check
BugLink: https://bugs.launchpad.net/bugs/1929615 [ Upstream commit b30d004 ] Iff platform_get_irq() returns 0, ahci_platform_init_host() would return 0 early (as if the call was successful). Override IRQ0 with -EINVAL instead as the 'libata' regards 0 as "no IRQ" (thus polling) anyway... Fixes: c034640 ("ata: libahci: properly propagate return value of platform_get_irq()") Signed-off-by: Sergey Shtylyov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
1 parent 366763b commit 1d89e2a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ata/libahci_platform.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platform_device *pdev,
582582
int i, irq, n_ports, rc;
583583

584584
irq = platform_get_irq(pdev, 0);
585-
if (irq <= 0) {
585+
if (irq < 0) {
586586
if (irq != -EPROBE_DEFER)
587587
dev_err(dev, "no irq\n");
588588
return irq;
589589
}
590+
if (!irq)
591+
return -EINVAL;
590592

591593
hpriv->irq = irq;
592594

0 commit comments

Comments
 (0)