omap_hsmmc_request_done(host, cmd->mrq);
}
+static void omap_hsmmc_free_dma(struct omap_hsmmc_host *host)
+{
+ int dma_ch;
+
+ dma_ch = xchg(&host->dma_ch_tx, -1);
+ if (dma_ch != -1)
+ omap_free_dma(dma_ch);
+
+ dma_ch = xchg(&host->dma_ch_rx, -1);
+ if (dma_ch != -1)
+ omap_free_dma(dma_ch);
+}
+
/*
* DMA clean up for command errors
*/
omap_hsmmc_get_dma_dir(host, host->data));
host->data->host_cookie = 0;
}
+ omap_hsmmc_free_dma(host);
host->data = NULL;
}
static int omap_hsmmc_runtime_suspend(struct device *dev)
{
struct omap_hsmmc_host *host;
- int dma_ch;
host = platform_get_drvdata(to_platform_device(dev));
omap_hsmmc_context_save(host);
- dma_ch = xchg(&host->dma_ch_tx, -1);
- if (dma_ch != -1)
- omap_free_dma(dma_ch);
-
- dma_ch = xchg(&host->dma_ch_rx, -1);
- if (dma_ch != -1)
- omap_free_dma(dma_ch);
+ omap_hsmmc_free_dma(host);
dev_dbg(mmc_dev(host->mmc), "disabled\n");