Skip to contentSkip to conversation

dmaengine: cppi41: Fix an Oops happening in cppi41_dma_probe()

PATCH Applied Alexandre Bailon 2 participants 2 messages Apr 5, 2017 – Apr 6, 2017 1 message not in the archive dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: cppi41: Fix an Oops happening in cppi41_dma_probe()

This fix an Oops happening on all platforms using the old dt bindings (all platforms but da8xx).
This update cppi41_dma_probe() to use the index variable which is required to keep compatibility between old and new dt bindings.

Fixes 8e3ba95f4190 ("dmaengine: cppi41: use managed functions devm_*()")
---
 drivers/dma/cppi41.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/cppi41.c +3 -3
index 0be56c9..f7e965f 100644
@@ -1038,17 +1038,17 @@ static int cppi41_dma_probe(struct platform_device *pdev)
 	if (index < 0)
 		return index;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, index);
 	cdd->ctrl_mem = devm_ioremap_resource(dev, mem);
 	if (IS_ERR(cdd->ctrl_mem))
 		return PTR_ERR(cdd->ctrl_mem);
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 1);
 	cdd->sched_mem = devm_ioremap_resource(dev, mem);
 	if (IS_ERR(cdd->sched_mem))
 		return PTR_ERR(cdd->sched_mem);
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 2);
 	cdd->qmgr_mem = devm_ioremap_resource(dev, mem);
 	if (IS_ERR(cdd->qmgr_mem))
 		return PTR_ERR(cdd->qmgr_mem);
Signature · 6 lines
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Alexandre Bailon

This fix an Oops happening on all platforms using the old dt bindings (all platforms but da8xx).
This update cppi41_dma_probe() to use the index variable which is required to keep compatibility between old and new dt bindings.

Applied, thanks

Signature · 5 lines
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html