提交 fb0ce9dd 编写于 作者: E Ezequiel Garcia 提交者: Ulf Hansson

mmc: jz4740: Use dma_request_chan()

Replace dma_request_channel() with dma_request_chan(),
which also supports probing from the devicetree.
Tested-by: NMathieu Malaterre <malat@debian.org>
Signed-off-by: NEzequiel Garcia <ezequiel@collabora.co.uk>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 6a78768a
......@@ -213,31 +213,23 @@ static void jz4740_mmc_release_dma_channels(struct jz4740_mmc_host *host)
static int jz4740_mmc_acquire_dma_channels(struct jz4740_mmc_host *host)
{
dma_cap_mask_t mask;
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
host->dma_tx = dma_request_channel(mask, NULL, host);
if (!host->dma_tx) {
host->dma_tx = dma_request_chan(mmc_dev(host->mmc), "tx");
if (IS_ERR(host->dma_tx)) {
dev_err(mmc_dev(host->mmc), "Failed to get dma_tx channel\n");
return -ENODEV;
return PTR_ERR(host->dma_tx);
}
host->dma_rx = dma_request_channel(mask, NULL, host);
if (!host->dma_rx) {
host->dma_rx = dma_request_chan(mmc_dev(host->mmc), "rx");
if (IS_ERR(host->dma_rx)) {
dev_err(mmc_dev(host->mmc), "Failed to get dma_rx channel\n");
goto free_master_write;
dma_release_channel(host->dma_tx);
return PTR_ERR(host->dma_rx);
}
/* Initialize DMA pre request cookie */
host->next_data.cookie = 1;
return 0;
free_master_write:
dma_release_channel(host->dma_tx);
return -ENODEV;
}
static inline struct dma_chan *jz4740_mmc_get_dma_chan(struct jz4740_mmc_host *host,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册