Commit 266ac3f2 authored by Linus Walleij's avatar Linus Walleij Committed by Chris Ball

mmc: atmel-mci: map DMA sglist on the DMA engine

As established for the MMCI, it is proper to map the DMA buffers
on the DMA engine which is the one actually performing the DMA.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 5fd11c07
...@@ -578,7 +578,8 @@ static void atmci_dma_cleanup(struct atmel_mci *host) ...@@ -578,7 +578,8 @@ static void atmci_dma_cleanup(struct atmel_mci *host)
struct mmc_data *data = host->data; struct mmc_data *data = host->data;
if (data) if (data)
dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len, dma_unmap_sg(host->dma.chan->device->dev,
data->sg, data->sg_len,
((data->flags & MMC_DATA_WRITE) ((data->flags & MMC_DATA_WRITE)
? DMA_TO_DEVICE : DMA_FROM_DEVICE)); ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
} }
...@@ -684,7 +685,8 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) ...@@ -684,7 +685,8 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
else else
direction = DMA_TO_DEVICE; direction = DMA_TO_DEVICE;
sglen = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, direction); sglen = dma_map_sg(chan->device->dev, data->sg,
data->sg_len, direction);
if (sglen != data->sg_len) if (sglen != data->sg_len)
goto unmap_exit; goto unmap_exit;
desc = chan->device->device_prep_slave_sg(chan, desc = chan->device->device_prep_slave_sg(chan,
...@@ -699,7 +701,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) ...@@ -699,7 +701,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
return 0; return 0;
unmap_exit: unmap_exit:
dma_unmap_sg(&host->pdev->dev, data->sg, sglen, direction); dma_unmap_sg(chan->device->dev, data->sg, sglen, direction);
return -ENOMEM; return -ENOMEM;
} }
......
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