@@ -1201,6 +1201,7 @@ static int sdhci_external_dma_setup(struct sdhci_host *host,
struct mmc_command *cmd)
{
int ret, i;
+ enum dma_transfer_direction dir;
struct dma_async_tx_descriptor *desc;
struct mmc_data *data = cmd->data;
struct dma_chan *chan;
@@ -1234,8 +1235,8 @@ static int sdhci_external_dma_setup(struct sdhci_host *host,
if (sg_cnt <= 0)
return -EINVAL;
- desc = dmaengine_prep_slave_sg(chan, data->sg, data->sg_len,
- mmc_get_dma_dir(data),
+ dir = data->flags & MMC_DATA_WRITE ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
+ desc = dmaengine_prep_slave_sg(chan, data->sg, data->sg_len, dir,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc)
return -EINVAL;