[PATCH v2] ata: libahci_platform: fix IRQ check

From
Sergey Shtylyov <hidden>
Date
2021-03-15 20:15:57
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: c034640a32f8 ("ata: libahci: properly propagate return value of platform_get_irq()")
Signed-off-by: Sergey Shtylyov <redacted>

---
Changes in version 2:
- added the "Fixes:" tag.

This patch is against the 'master' branch of Jens Axboe's 'linux-block.git'
repo.

 drivers/ata/libahci_platform.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-block/drivers/ata/libahci_platform.c
===================================================================
--- linux-block.orig/drivers/ata/libahci_platform.c
+++ linux-block/drivers/ata/libahci_platform.c
@@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platf
 	int i, irq, n_ports, rc;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	if (irq < 0) {
 		if (irq != -EPROBE_DEFER)
 			dev_err(dev, "no irq\n");
 		return irq;
 	}
+	if (!irq)
+		return -EINVAL;
 
 	hpriv->irq = irq;
 
Thread (2 messages) 2 messages, 2 authors, last reply 2021-03-31
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help