Skip to content

Commit 1d89e2a

Browse files
Sergey Shtylyovksacilotto
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 <s.shtylyov@omprussia.ru> Link: https://lore.kernel.org/r/4448c8cc-331f-2915-0e17-38ea34e251c8@omprussia.ru Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
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)