Skip to contentSkip to conversation

mmc: davinci: remove incorrect NO_IRQ use

PATCH Applied Arnd Bergmann 2 participants 2 messages Sep 6, 2016 – Sep 9, 2016 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: davinci: remove incorrect NO_IRQ use

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.

---
 drivers/mmc/host/davinci_mmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/davinci_mmc.c +4 -2
index c521559412fc..67ef4810b3de 100644
@@ -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,
Signature · 1 line
2.9.0
Applied
#1 lore raw
Quoted 6 lines · Arnd Bergmann

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.

Thanks, applied for next!

Kind regards
Uffe

Quoted 25 lines
---
 drivers/mmc/host/davinci_mmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/davinci_mmc.c +4 -3
index c521559412fc..67ef4810b3de 100644
@@ -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,
--

2.9.0