mmc: use new core function mmc_get_dma_dir
Use new core function mmc_get_dma_dir(). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:

committato da
Ulf Hansson

parent
6335d68349
commit
feeef096a7
@@ -385,14 +385,6 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
|
||||
wmb();
|
||||
}
|
||||
|
||||
static enum dma_data_direction sunxi_mmc_get_dma_dir(struct mmc_data *data)
|
||||
{
|
||||
if (data->flags & MMC_DATA_WRITE)
|
||||
return DMA_TO_DEVICE;
|
||||
else
|
||||
return DMA_FROM_DEVICE;
|
||||
}
|
||||
|
||||
static int sunxi_mmc_map_dma(struct sunxi_mmc_host *host,
|
||||
struct mmc_data *data)
|
||||
{
|
||||
@@ -400,7 +392,7 @@ static int sunxi_mmc_map_dma(struct sunxi_mmc_host *host,
|
||||
struct scatterlist *sg;
|
||||
|
||||
dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
|
||||
sunxi_mmc_get_dma_dir(data));
|
||||
mmc_get_dma_dir(data));
|
||||
if (dma_len == 0) {
|
||||
dev_err(mmc_dev(host->mmc), "dma_map_sg failed\n");
|
||||
return -ENOMEM;
|
||||
@@ -551,7 +543,7 @@ static irqreturn_t sunxi_mmc_finalize_request(struct sunxi_mmc_host *host)
|
||||
rval |= SDXC_FIFO_RESET;
|
||||
mmc_writel(host, REG_GCTRL, rval);
|
||||
dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
|
||||
sunxi_mmc_get_dma_dir(data));
|
||||
mmc_get_dma_dir(data));
|
||||
}
|
||||
|
||||
mmc_writel(host, REG_RINTR, 0xffff);
|
||||
@@ -1022,7 +1014,7 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
||||
|
||||
if (data)
|
||||
dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len,
|
||||
sunxi_mmc_get_dma_dir(data));
|
||||
mmc_get_dma_dir(data));
|
||||
|
||||
dev_err(mmc_dev(mmc), "request already pending\n");
|
||||
mrq->cmd->error = -EBUSY;
|
||||
|
Fai riferimento in un nuovo problema
Block a user