Commit 78f35083 authored by Christian Lütke-Stetzkamp's avatar Christian Lütke-Stetzkamp Committed by Greg Kroah-Hartman

staging: mt7621-mmc: Replace dma dir with mmc_get_dma_dir

Currently the dma direction is manually determined by the read status,
there is a more portable function for it, mmc_get_dma_dir, use it.
Signed-off-by: default avatarChristian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: default avatarNeilBrown <neil@brown.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c302214c
...@@ -1360,7 +1360,7 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) ...@@ -1360,7 +1360,7 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
u32 base = host->base; u32 base = host->base;
//u32 intsts = 0; //u32 intsts = 0;
unsigned int left = 0; unsigned int left = 0;
int dma = 0, read = 1, dir = DMA_FROM_DEVICE, send_type = 0; int dma = 0, read = 1, send_type = 0;
#define SND_DAT 0 #define SND_DAT 0
#define SND_CMD 1 #define SND_CMD 1
...@@ -1422,9 +1422,9 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) ...@@ -1422,9 +1422,9 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
if (msdc_command_start(host, cmd, 1, CMD_TIMEOUT) != 0) if (msdc_command_start(host, cmd, 1, CMD_TIMEOUT) != 0)
goto done; goto done;
dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
data->sg_count = dma_map_sg(mmc_dev(mmc), data->sg, data->sg_count = dma_map_sg(mmc_dev(mmc), data->sg,
data->sg_len, dir); data->sg_len,
mmc_get_dma_dir(data));
msdc_dma_setup(host, &host->dma, data->sg, msdc_dma_setup(host, &host->dma, data->sg,
data->sg_count); data->sg_count);
...@@ -1505,7 +1505,8 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) ...@@ -1505,7 +1505,8 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
host->dma_xfer = 0; host->dma_xfer = 0;
if (dma != 0) { if (dma != 0) {
msdc_dma_off(); msdc_dma_off();
dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len, dir); dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len,
mmc_get_dma_dir(data));
} }
host->blksz = 0; host->blksz = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment