From: Subhash Jadavani Date: Mon, 2 May 2011 12:40:40 +0000 (+0530) Subject: mmc: msm_sdcc: Handle dma resource not present case X-Git-Tag: v3.2~422^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=190657c9f464b9f99a05a6ed8476c8bbccbc6a8b;p=platform%2Fkernel%2Flinux-amlogic.git mmc: msm_sdcc: Handle dma resource not present case If DMA resource is not available then SDCC driver should atleast work in PIO data transfer mode. Signed-off-by: Subhash Jadavani Signed-off-by: Sahitya Tummala Signed-off-by: David Brown Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index a835ac0..61c7d38 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c @@ -1242,9 +1242,13 @@ msmsdcc_probe(struct platform_device *pdev) /* * Setup DMA */ - ret = msmsdcc_init_dma(host); - if (ret) - goto ioremap_free; + if (host->dmares) { + ret = msmsdcc_init_dma(host); + if (ret) + goto ioremap_free; + } else { + host->dma.channel = -1; + } /* Get our clocks */ host->pclk = clk_get(&pdev->dev, "sdc_pclk"); @@ -1388,8 +1392,9 @@ msmsdcc_probe(struct platform_device *pdev) pclk_put: clk_put(host->pclk); dma_free: - dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), - host->dma.nc, host->dma.nc_busaddr); + if (host->dmares) + dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), + host->dma.nc, host->dma.nc_busaddr); ioremap_free: tasklet_kill(&host->dma_tlet); iounmap(host->base);