mmc: sh_mmcif: unmap with the proper sglen
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Feb 2011 15:09:40 +0000 (16:09 +0100)
committerChris Ball <cjb@laptop.org>
Tue, 15 Mar 2011 17:49:12 +0000 (13:49 -0400)
According to the DMA-API you shall unmap the sglists with the same
sglist length as passed into the mapping function, not the
returned value from the mapping function.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sh_mmcif.c

index 8e4aba90d6a495ce55a6754fd88006baa6b27ccd..61ad19ecfbf8384e89495baa4f3935777f55f8f2 100644 (file)
@@ -195,11 +195,11 @@ static void mmcif_dma_complete(void *arg)
 
        if (host->data->flags & MMC_DATA_READ)
                dma_unmap_sg(host->chan_rx->device->dev,
-                            host->data->sg, host->dma_sglen,
+                            host->data->sg, host->data->sg_len,
                             DMA_FROM_DEVICE);
        else
                dma_unmap_sg(host->chan_tx->device->dev,
-                            host->data->sg, host->dma_sglen,
+                            host->data->sg, host->data->sg_len,
                             DMA_TO_DEVICE);
 
        complete(&host->dma_complete);