[PATCH] mci: sdhci: fix dma mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


In case of MMC_DATA_READ the dest address should be used and in case of
MMC_DATA_WRITE the src address should be used. We had no issues for now
since both dest and src point to same address due to the union.

Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
 drivers/mci/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index edb819d66d42..a141e504971b 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -233,10 +233,10 @@ void sdhci_setup_data_dma(struct sdhci *sdhci, struct mci_data *data,
 	nbytes = data->blocks * data->blocksize;
 	if (data->flags & MMC_DATA_READ)
-		*dma = dma_map_single(dev, (void *)data->src, nbytes,
+		*dma = dma_map_single(dev, data->dest, nbytes,
-		*dma = dma_map_single(dev, data->dest, nbytes,
+		*dma = dma_map_single(dev, (void *)data->src, nbytes,
 	if (dma_mapping_error(dev, *dma)) {

[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux