]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/mm/dma-default.c
MIPS: Add missing calls to plat_unmap_dma_mem.
[linux-2.6-omap-h63xx.git] / arch / mips / mm / dma-default.c
index 891312f8e5a6b19d01b6485cda535821520e346c..e6708b3ad343f478e15a7d1102a90df2c7f61841 100644 (file)
@@ -111,6 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
 void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
        dma_addr_t dma_handle)
 {
+       plat_unmap_dma_mem(dma_handle);
        free_pages((unsigned long) vaddr, get_order(size));
 }
 
@@ -121,6 +122,8 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
 {
        unsigned long addr = (unsigned long) vaddr;
 
+       plat_unmap_dma_mem(dma_handle);
+
        if (!plat_device_is_coherent(dev))
                addr = CAC_ADDR(addr);
 
@@ -324,7 +327,6 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
                if (cpu_is_noncoherent_r10000(dev))
                        __dma_sync((unsigned long)page_address(sg_page(sg)),
                                   sg->length, direction);
-               plat_unmap_dma_mem(sg->dma_address);
        }
 }
 
@@ -342,7 +344,6 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nele
                if (!plat_device_is_coherent(dev))
                        __dma_sync((unsigned long)page_address(sg_page(sg)),
                                   sg->length, direction);
-               plat_unmap_dma_mem(sg->dma_address);
        }
 }