Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <subhashj@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by

Subhash Jadavani and committed by
Chris Ball
190657c9 19207f05

+10 -5
+10 -5
drivers/mmc/host/msm_sdcc.c
··· 1242 1242 /* 1243 1243 * Setup DMA 1244 1244 */ 1245 - ret = msmsdcc_init_dma(host); 1246 - if (ret) 1247 - goto ioremap_free; 1245 + if (host->dmares) { 1246 + ret = msmsdcc_init_dma(host); 1247 + if (ret) 1248 + goto ioremap_free; 1249 + } else { 1250 + host->dma.channel = -1; 1251 + } 1248 1252 1249 1253 /* Get our clocks */ 1250 1254 host->pclk = clk_get(&pdev->dev, "sdc_pclk"); ··· 1392 1388 pclk_put: 1393 1389 clk_put(host->pclk); 1394 1390 dma_free: 1395 - dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), 1396 - host->dma.nc, host->dma.nc_busaddr); 1391 + if (host->dmares) 1392 + dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata), 1393 + host->dma.nc, host->dma.nc_busaddr); 1397 1394 ioremap_free: 1398 1395 tasklet_kill(&host->dma_tlet); 1399 1396 iounmap(host->base);