]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Changed dma-mapping direction for dma_unmap_sg
authorTony Lindgren <tony@atomide.com>
Tue, 21 Jun 2005 18:11:32 +0000 (11:11 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 21 Jun 2005 18:11:32 +0000 (11:11 -0700)
Fixed the wrong direction of dma-mapping flags as noted by
David Brownell.

drivers/mmc/omap.c

index 1c09a5b05dadbdeaa8018612f14577193de9306b..2c034e8cc478780dea6eda2033244c19718f8a8c 100644 (file)
@@ -234,6 +234,8 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd)
 static void
 mmc_omap_xfer_done(struct mmc_omap_host *host, struct mmc_data *data)
 {
+       enum dma_data_direction dma_data_dir;
+
        host->data = NULL;
        host->datadir = OMAP_MMC_DATADIR_NONE;
 
@@ -250,8 +252,14 @@ mmc_omap_xfer_done(struct mmc_omap_host *host, struct mmc_data *data)
                }
        }
 
+       if (host->datadir == OMAP_MMC_DATADIR_WRITE)
+               dma_data_dir = DMA_TO_DEVICE;
+       else
+               dma_data_dir = DMA_FROM_DEVICE;
+
        dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len,
-                    host->datadir);
+                    dma_data_dir);
+
        host->dma_len = 0;
 
        clk_unuse(host->clk);