diff mbox

mmc: davinci: remove incorrect NO_IRQ use

Message ID 20160906125633.1563621-1-arnd@arndb.de
State New
Headers show

Commit Message

Arnd Bergmann Sept. 6, 2016, 12:56 p.m. UTC
platform_get_irq() returns an error value on failure, not NO_IRQ,
so the error handling here could never work.

This changes the code to propagate the error value instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/mmc/host/davinci_mmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index c521559412fc..67ef4810b3de 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1216,9 +1216,11 @@  static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 	}
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	irq = platform_get_irq(pdev, 0);
-	if (!r || irq == NO_IRQ)
+	if (!r)
 		return -ENODEV;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	mem_size = resource_size(r);
 	mem = devm_request_mem_region(&pdev->dev, r->start, mem_size,