serial: sh-sci: Kill off all of the SCI/SCIF special casing.
[pandora-kernel.git] / arch / arm / mm / consistent.c
index 1f9f94f..db7b3e3 100644 (file)
@@ -274,6 +274,11 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
 void *
 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
 {
+       void *memory;
+
+       if (dma_alloc_from_coherent(dev, size, handle, &memory))
+               return memory;
+
        if (arch_is_coherent()) {
                void *virt;
 
@@ -322,7 +327,6 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
 
                if (off < kern_size &&
                    user_size <= (kern_size - off)) {
-                       vma->vm_flags |= VM_RESERVED;
                        ret = remap_pfn_range(vma, vma->vm_start,
                                              page_to_pfn(c->vm_pages) + off,
                                              user_size << PAGE_SHIFT,
@@ -363,6 +367,9 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
 
        WARN_ON(irqs_disabled());
 
+       if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
+               return;
+
        if (arch_is_coherent()) {
                kfree(cpu_addr);
                return;
@@ -481,7 +488,7 @@ core_initcall(consistent_init);
  * platforms with CONFIG_DMABOUNCE.
  * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
  */
-void consistent_sync(const void *start, size_t size, int direction)
+void dma_cache_maint(const void *start, size_t size, int direction)
 {
        const void *end = start + size;
 
@@ -504,4 +511,4 @@ void consistent_sync(const void *start, size_t size, int direction)
                BUG();
        }
 }
-EXPORT_SYMBOL(consistent_sync);
+EXPORT_SYMBOL(dma_cache_maint);