]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mm/dma-mapping.c
[ARM] dma: Reduce to one dma_sync_sg_* implementation
[linux-2.6-omap-h63xx.git] / arch / arm / mm / dma-mapping.c
index c9c1206e358c4a7058104e5cd7666eda79e38556..0e28cf33f7dd96bc2f28d085e0c9494aa4afaae1 100644 (file)
@@ -571,7 +571,6 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
 }
 EXPORT_SYMBOL(dma_unmap_sg);
 
-#ifndef CONFIG_DMABOUNCE
 /**
  * dma_sync_sg_for_cpu
  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
@@ -586,6 +585,10 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
        int i;
 
        for_each_sg(sg, s, nents, i) {
+               if (!dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0,
+                                       sg_dma_len(s), dir))
+                       continue;
+
                if (!arch_is_coherent())
                        dma_cache_maint(sg_virt(s), s->length, dir);
        }
@@ -606,9 +609,12 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
        int i;
 
        for_each_sg(sg, s, nents, i) {
+               if (!dmabounce_sync_for_device(dev, sg_dma_address(s), 0,
+                                       sg_dma_len(s), dir))
+                       continue;
+
                if (!arch_is_coherent())
                        dma_cache_maint(sg_virt(s), s->length, dir);
        }
 }
 EXPORT_SYMBOL(dma_sync_sg_for_device);
-#endif