diff options
author | Alexandre Bailon <abailon@baylibre.com> | 2017-04-05 12:35:16 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2017-04-06 03:11:59 -0400 |
commit | eda6f4e868e74adfae8ac6b06a863a090affbb14 (patch) | |
tree | 8f92cf568ea226547961cbdad9e3c0272097dcb5 | |
parent | d7fd724e01939f777781a86d078c3b7142fb9c03 (diff) |
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_*()")
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/cppi41.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 0be56c971786..f7e965f63274 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c | |||
@@ -1038,17 +1038,17 @@ static int cppi41_dma_probe(struct platform_device *pdev) | |||
1038 | if (index < 0) | 1038 | if (index < 0) |
1039 | return index; | 1039 | return index; |
1040 | 1040 | ||
1041 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1041 | mem = platform_get_resource(pdev, IORESOURCE_MEM, index); |
1042 | cdd->ctrl_mem = devm_ioremap_resource(dev, mem); | 1042 | cdd->ctrl_mem = devm_ioremap_resource(dev, mem); |
1043 | if (IS_ERR(cdd->ctrl_mem)) | 1043 | if (IS_ERR(cdd->ctrl_mem)) |
1044 | return PTR_ERR(cdd->ctrl_mem); | 1044 | return PTR_ERR(cdd->ctrl_mem); |
1045 | 1045 | ||
1046 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1046 | mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 1); |
1047 | cdd->sched_mem = devm_ioremap_resource(dev, mem); | 1047 | cdd->sched_mem = devm_ioremap_resource(dev, mem); |
1048 | if (IS_ERR(cdd->sched_mem)) | 1048 | if (IS_ERR(cdd->sched_mem)) |
1049 | return PTR_ERR(cdd->sched_mem); | 1049 | return PTR_ERR(cdd->sched_mem); |
1050 | 1050 | ||
1051 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 2); | 1051 | mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 2); |
1052 | cdd->qmgr_mem = devm_ioremap_resource(dev, mem); | 1052 | cdd->qmgr_mem = devm_ioremap_resource(dev, mem); |
1053 | if (IS_ERR(cdd->qmgr_mem)) | 1053 | if (IS_ERR(cdd->qmgr_mem)) |
1054 | return PTR_ERR(cdd->qmgr_mem); | 1054 | return PTR_ERR(cdd->qmgr_mem); |