diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2011-02-10 10:08:06 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-03-15 13:49:02 -0400 |
commit | 266ac3f297adb72fb6c34949a38337c6fad4c7a6 (patch) | |
tree | 29b69f8643854d700e2da49e37cf6384357963dc /drivers/mmc/host/atmel-mci.c | |
parent | 5fd11c0754fa069b6aba64b65734aa2fb193552d (diff) |
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: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index ad2a7a032cdf..045bdbbe3720 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -578,7 +578,8 @@ static void atmci_dma_cleanup(struct atmel_mci *host) | |||
578 | struct mmc_data *data = host->data; | 578 | struct mmc_data *data = host->data; |
579 | 579 | ||
580 | if (data) | 580 | if (data) |
581 | dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len, | 581 | dma_unmap_sg(host->dma.chan->device->dev, |
582 | data->sg, data->sg_len, | ||
582 | ((data->flags & MMC_DATA_WRITE) | 583 | ((data->flags & MMC_DATA_WRITE) |
583 | ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); | 584 | ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); |
584 | } | 585 | } |
@@ -684,7 +685,8 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) | |||
684 | else | 685 | else |
685 | direction = DMA_TO_DEVICE; | 686 | direction = DMA_TO_DEVICE; |
686 | 687 | ||
687 | sglen = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, direction); | 688 | sglen = dma_map_sg(chan->device->dev, data->sg, |
689 | data->sg_len, direction); | ||
688 | if (sglen != data->sg_len) | 690 | if (sglen != data->sg_len) |
689 | goto unmap_exit; | 691 | goto unmap_exit; |
690 | desc = chan->device->device_prep_slave_sg(chan, | 692 | 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 | 701 | ||
700 | return 0; | 702 | return 0; |
701 | unmap_exit: | 703 | unmap_exit: |
702 | dma_unmap_sg(&host->pdev->dev, data->sg, sglen, direction); | 704 | dma_unmap_sg(chan->device->dev, data->sg, sglen, direction); |
703 | return -ENOMEM; | 705 | return -ENOMEM; |
704 | } | 706 | } |
705 | 707 | ||