]> git.hungrycats.org Git - linux/commitdiff
[ARM] Remove consistent_alloc/consistent_free
authorRussell King <rmk@flint.arm.linux.org.uk>
Mon, 29 Mar 2004 18:51:04 +0000 (19:51 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Mon, 29 Mar 2004 18:51:04 +0000 (19:51 +0100)
Since we've eliminated users of these functions, we can unexport
them.  Instead, drivers should use the DMA API interfaces.

arch/arm/mm/consistent.c
include/asm-arm/dma-mapping.h

index 3b98c4806f02c57f83d30f8df56f223a34f122d3..933ca5adddc8c005e7e1b50bdfad01192d7e119c 100644 (file)
@@ -134,6 +134,7 @@ static struct vm_region *vm_region_find(struct vm_region *head, unsigned long ad
  * This allocates one page of cache-coherent memory space and returns
  * both the virtual and a "dma" address to that space.
  */
+static
 void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle,
                       unsigned long cache_flags)
 {
@@ -209,7 +210,6 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle,
  no_page:
        return NULL;
 }
-EXPORT_SYMBOL(consistent_alloc);
 
 /*
  * Since we have the DMA mask available to us here, we could try to do
@@ -243,7 +243,7 @@ EXPORT_SYMBOL(dma_alloc_writecombine);
 /*
  * free a page as defined by the above mapping.
  */
-void consistent_free(void *vaddr, size_t size, dma_addr_t handle)
+void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
 {
        struct vm_region *c;
        unsigned long flags;
@@ -253,7 +253,7 @@ void consistent_free(void *vaddr, size_t size, dma_addr_t handle)
 
        spin_lock_irqsave(&consistent_lock, flags);
 
-       c = vm_region_find(&consistent_head, (unsigned long)vaddr);
+       c = vm_region_find(&consistent_head, (unsigned long)cpu_addr);
        if (!c)
                goto no_area;
 
@@ -302,7 +302,7 @@ void consistent_free(void *vaddr, size_t size, dma_addr_t handle)
               "invalid area: %p\n", vaddr);
        dump_stack();
 }
-EXPORT_SYMBOL(consistent_free);
+EXPORT_SYMBOL(dma_free_coherent);
 
 /*
  * Initialise the consistent memory allocation.
index 653b01bce2856477212c4761b2813f46fe5882be..c65d9e38ddc7e6fc1cb8524fe8f5101591953c04 100644 (file)
@@ -14,8 +14,6 @@
  * devices.  This is the "generic" version.  The PCI specific version
  * is in pci.h
  */
-extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle, unsigned long flags);
-extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
 extern void consistent_sync(void *kaddr, size_t size, int rw);
 
 /*
@@ -99,12 +97,9 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp)
  * References to memory and mappings associated with cpu_addr/handle
  * during and after this call executing are illegal.
  */
-static inline void
+extern void
 dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
-                 dma_addr_t handle)
-{
-       consistent_free(cpu_addr, size, handle);
-}
+                 dma_addr_t handle);
 
 /**
  * dma_alloc_writecombine - allocate writecombining memory for DMA