Skip to content

Commit

Permalink
dmaengine: cppi41: Fix an Oops happening in cppi41_dma_probe()
Browse files Browse the repository at this point in the history
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: 8e3ba95 ("dmaengine: cppi41: use managed functions devm_*()")
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Alexandre Bailon authored and Vinod Koul committed Apr 6, 2017
1 parent d7fd724 commit eda6f4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/dma/cppi41.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eda6f4e

Please sign in to comment.