Merge branch 'mm-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 14 Mar 2016 23:31:41 +0000 (16:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 14 Mar 2016 23:31:41 +0000 (16:31 -0700)
Pull dma_*_writecombine rename from Ingo Molnar:
 "Rename dma_*_writecombine() to dma_*_wc()

  This is a tree-wide API rename, to move the dma_*() write-combining
  APIs closer in name to their usual API families.  (The old API names
  are kept as compatibility wrappers to not introduce extra breakage.)

  The patch was Coccinelle generated"

* 'mm-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc()

1  2 
include/linux/dma-mapping.h

index 728ef074602a69d6046e6ff68f10ea84bdc172cd,471e064af29f8998d71366af16813dd3472f09b2..5e45cf930a3f53fc7071f42a5759fe3dd5fd6a31
@@@ -386,7 -386,7 +386,7 @@@ static inline void dma_free_attrs(struc
        if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
                return;
  
 -      if (!ops->free)
 +      if (!ops->free || !cpu_addr)
                return;
  
        debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
@@@ -641,31 -641,40 +641,40 @@@ static inline void dmam_release_declare
  }
  #endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
  
- static inline void *dma_alloc_writecombine(struct device *dev, size_t size,
-                                          dma_addr_t *dma_addr, gfp_t gfp)
+ static inline void *dma_alloc_wc(struct device *dev, size_t size,
+                                dma_addr_t *dma_addr, gfp_t gfp)
  {
        DEFINE_DMA_ATTRS(attrs);
        dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
        return dma_alloc_attrs(dev, size, dma_addr, gfp, &attrs);
  }
+ #ifndef dma_alloc_writecombine
+ #define dma_alloc_writecombine dma_alloc_wc
+ #endif
  
- static inline void dma_free_writecombine(struct device *dev, size_t size,
-                                        void *cpu_addr, dma_addr_t dma_addr)
+ static inline void dma_free_wc(struct device *dev, size_t size,
+                              void *cpu_addr, dma_addr_t dma_addr)
  {
        DEFINE_DMA_ATTRS(attrs);
        dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
        return dma_free_attrs(dev, size, cpu_addr, dma_addr, &attrs);
  }
+ #ifndef dma_free_writecombine
+ #define dma_free_writecombine dma_free_wc
+ #endif
  
- static inline int dma_mmap_writecombine(struct device *dev,
-                                       struct vm_area_struct *vma,
-                                       void *cpu_addr, dma_addr_t dma_addr,
-                                       size_t size)
+ static inline int dma_mmap_wc(struct device *dev,
+                             struct vm_area_struct *vma,
+                             void *cpu_addr, dma_addr_t dma_addr,
+                             size_t size)
  {
        DEFINE_DMA_ATTRS(attrs);
        dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
        return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size, &attrs);
  }
+ #ifndef dma_mmap_writecombine
+ #define dma_mmap_writecombine dma_mmap_wc
+ #endif
  
  #ifdef CONFIG_NEED_DMA_MAP_STATE
  #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME