提交 eda6f4e8 编写于 作者: A Alexandre Bailon 提交者: Vinod Koul

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: 8e3ba95f ("dmaengine: cppi41: use managed functions devm_*()")
Reported-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NAlexandre Bailon <abailon@baylibre.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 d7fd724e
...@@ -1038,17 +1038,17 @@ static int cppi41_dma_probe(struct platform_device *pdev) ...@@ -1038,17 +1038,17 @@ static int cppi41_dma_probe(struct platform_device *pdev)
if (index < 0) if (index < 0)
return index; 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); cdd->ctrl_mem = devm_ioremap_resource(dev, mem);
if (IS_ERR(cdd->ctrl_mem)) if (IS_ERR(cdd->ctrl_mem))
return PTR_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); cdd->sched_mem = devm_ioremap_resource(dev, mem);
if (IS_ERR(cdd->sched_mem)) if (IS_ERR(cdd->sched_mem))
return PTR_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); cdd->qmgr_mem = devm_ioremap_resource(dev, mem);
if (IS_ERR(cdd->qmgr_mem)) if (IS_ERR(cdd->qmgr_mem))
return PTR_ERR(cdd->qmgr_mem); return PTR_ERR(cdd->qmgr_mem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册