Skip to content
Snippets Groups Projects
Commit 4f53ef0f authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Greg Kroah-Hartman
Browse files

ata: libahci_platform: fix IRQ check


[ Upstream commit b30d0040 ]

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: c034640a ("ata: libahci: properly propagate return value of platform_get_irq()")
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omprussia.ru>
Link: https://lore.kernel.org/r/4448c8cc-331f-2915-0e17-38ea34e251c8@omprussia.ru


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6187fa25
No related branches found
No related tags found
No related merge requests found
...@@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platform_device *pdev, ...@@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platform_device *pdev,
int i, irq, n_ports, rc; int i, irq, n_ports, rc;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq < 0) {
if (irq != -EPROBE_DEFER) if (irq != -EPROBE_DEFER)
dev_err(dev, "no irq\n"); dev_err(dev, "no irq\n");
return irq; return irq;
} }
if (!irq)
return -EINVAL;
hpriv->irq = irq; hpriv->irq = irq;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment