From: Linus Walleij Date: Thu, 10 Feb 2011 15:08:06 +0000 (+0100) Subject: mmc: atmel-mci: map DMA sglist on the DMA engine X-Git-Tag: upstream/snapshot3+hdmi~11159^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=266ac3f297adb72fb6c34949a38337c6fad4c7a6;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Nicolas Ferre Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index ad2a7a0..045bdbb 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) struct mmc_data *data = host->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) ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); } @@ -684,7 +685,8 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) else 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) goto unmap_exit; desc = chan->device->device_prep_slave_sg(chan, @@ -699,7 +701,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) return 0; unmap_exit: - dma_unmap_sg(&host->pdev->dev, data->sg, sglen, direction); + dma_unmap_sg(chan->device->dev, data->sg, sglen, direction); return -ENOMEM; }