Commit 92707841 authored by Christian Lütke-Stetzkamp's avatar Christian Lütke-Stetzkamp Committed by Greg Kroah-Hartman

staging: mt7621-mmc: Fix dma_alloc_coherent should get device as first param

The dma_alloc_coherent (and also dma_free_coherent) should get the
device, the dma memory is allocated for as the first parameter.
Signed-off-by: default avatarChristian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: default avatarNeilBrown <neil@brown.name>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a03a6839
...@@ -2779,8 +2779,12 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -2779,8 +2779,12 @@ static int msdc_drv_probe(struct platform_device *pdev)
mmc_dev(mmc)->dma_mask = NULL; mmc_dev(mmc)->dma_mask = NULL;
/* using dma_alloc_coherent*/ /* todo: using 1, for all 4 slots */ /* using dma_alloc_coherent*/ /* todo: using 1, for all 4 slots */
host->dma.gpd = dma_alloc_coherent(NULL, MAX_GPD_NUM * sizeof(struct gpd), &host->dma.gpd_addr, GFP_KERNEL); host->dma.gpd = dma_alloc_coherent(&pdev->dev,
host->dma.bd = dma_alloc_coherent(NULL, MAX_BD_NUM * sizeof(struct bd), &host->dma.bd_addr, GFP_KERNEL); MAX_GPD_NUM * sizeof(struct gpd),
&host->dma.gpd_addr, GFP_KERNEL);
host->dma.bd = dma_alloc_coherent(&pdev->dev,
MAX_BD_NUM * sizeof(struct bd),
&host->dma.bd_addr, GFP_KERNEL);
if (!host->dma.gpd || !host->dma.bd) { if (!host->dma.gpd || !host->dma.bd) {
ret = -ENOMEM; ret = -ENOMEM;
goto release_mem; goto release_mem;
...@@ -2835,10 +2839,10 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -2835,10 +2839,10 @@ static int msdc_drv_probe(struct platform_device *pdev)
release_mem: release_mem:
if (host->dma.gpd) if (host->dma.gpd)
dma_free_coherent(NULL, MAX_GPD_NUM * sizeof(struct gpd), dma_free_coherent(&pdev->dev, MAX_GPD_NUM * sizeof(struct gpd),
host->dma.gpd, host->dma.gpd_addr); host->dma.gpd, host->dma.gpd_addr);
if (host->dma.bd) if (host->dma.bd)
dma_free_coherent(NULL, MAX_BD_NUM * sizeof(struct bd), dma_free_coherent(&pdev->dev, MAX_BD_NUM * sizeof(struct bd),
host->dma.bd, host->dma.bd_addr); host->dma.bd, host->dma.bd_addr);
host_free: host_free:
mmc_free_host(mmc); mmc_free_host(mmc);
...@@ -2871,8 +2875,10 @@ static int msdc_drv_remove(struct platform_device *pdev) ...@@ -2871,8 +2875,10 @@ static int msdc_drv_remove(struct platform_device *pdev)
#endif #endif
free_irq(host->irq, host); free_irq(host->irq, host);
dma_free_coherent(NULL, MAX_GPD_NUM * sizeof(struct gpd), host->dma.gpd, host->dma.gpd_addr); dma_free_coherent(&pdev->dev, MAX_GPD_NUM * sizeof(struct gpd),
dma_free_coherent(NULL, MAX_BD_NUM * sizeof(struct bd), host->dma.bd, host->dma.bd_addr); host->dma.gpd, host->dma.gpd_addr);
dma_free_coherent(&pdev->dev, MAX_BD_NUM * sizeof(struct bd),
host->dma.bd, host->dma.bd_addr);
mmc_free_host(host->mmc); mmc_free_host(host->mmc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment