]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
dma-mapping: remove dma_alloc_noncoherent and dma_free_noncoherent
authorChristoph Hellwig <hch@lst.de>
Fri, 25 Aug 2017 15:06:13 +0000 (17:06 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 29 Aug 2017 08:04:02 +0000 (10:04 +0200)
No users left, everyone switched to the _attrs versions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Documentation/DMA-API.txt
arch/metag/include/asm/dma-mapping.h
arch/nios2/include/asm/dma-mapping.h
arch/tile/include/asm/dma-mapping.h
include/linux/dma-mapping.h

index 45b29326d719b25395accc371177348a52ca1ace..ef3a04fcad655f2efd9989f9b810314233c90bee 100644 (file)
@@ -515,14 +515,15 @@ API at all.
 ::
 
        void *
-       dma_alloc_noncoherent(struct device *dev, size_t size,
-                             dma_addr_t *dma_handle, gfp_t flag)
+       dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
+                       gfp_t flag, unsigned long attrs)
 
-Identical to dma_alloc_coherent() except that the platform will
-choose to return either consistent or non-consistent memory as it sees
-fit.  By using this API, you are guaranteeing to the platform that you
-have all the correct and necessary sync points for this memory in the
-driver should it choose to return non-consistent memory.
+Identical to dma_alloc_coherent() except that when the
+DMA_ATTR_NON_CONSISTENT flags is passed in the attrs argument, the
+platform will choose to return either consistent or non-consistent memory
+as it sees fit.  By using this API, you are guaranteeing to the platform
+that you have all the correct and necessary sync points for this memory
+in the driver should it choose to return non-consistent memory.
 
 Note: where the platform can return consistent memory, it will
 guarantee that the sync points become nops.
@@ -535,12 +536,13 @@ that simply cannot make consistent memory.
 ::
 
        void
-       dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
-                            dma_addr_t dma_handle)
+       dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
+                      dma_addr_t dma_handle, unsigned long attrs)
 
-Free memory allocated by the nonconsistent API.  All parameters must
-be identical to those passed in (and returned by
-dma_alloc_noncoherent()).
+Free memory allocated by the dma_alloc_attrs().  All parameters common
+parameters must identical to those otherwise passed to dma_fre_coherent,
+and the attrs argument must be identical to the attrs passed to
+dma_alloc_attrs().
 
 ::
 
@@ -564,8 +566,8 @@ memory or doing partial flushes.
        dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                       enum dma_data_direction direction)
 
-Do a partial sync of memory that was allocated by
-dma_alloc_noncoherent(), starting at virtual address vaddr and
+Do a partial sync of memory that was allocated by dma_alloc_attrs() with
+the DMA_ATTR_NON_CONSISTENT flag starting at virtual address vaddr and
 continuing on for size.  Again, you *must* observe the cache line
 boundaries when doing this.
 
index fad3dc3cb21008c59d612827c40282fae34d1827..ea573be2b6d0550e46a170c8a72178953022f4f3 100644 (file)
@@ -9,7 +9,7 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 }
 
 /*
- * dma_alloc_noncoherent() returns non-cacheable memory, so there's no need to
+ * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to
  * do any flushing here.
  */
 static inline void
index 7b3c6f280293aeb5cdd13b1de341f0e74f36bf2d..f8dc622227414abf8852c5c0718c2f832512eb50 100644 (file)
@@ -18,7 +18,7 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 }
 
 /*
- * dma_alloc_noncoherent() returns non-cacheable memory, so there's no need to
+ * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to
  * do any flushing here.
  */
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
index bbc71a29b2c6a860abf9d7a9d81a6ad75a57f7a1..7061dc8af43af0681208f0fef5b769a99348f346 100644 (file)
@@ -68,8 +68,8 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 int dma_set_mask(struct device *dev, u64 mask);
 
 /*
- * dma_alloc_noncoherent() is #defined to return coherent memory,
- * so there's no need to do any flushing here.
+ * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to
+ * do any flushing here.
  */
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                                  enum dma_data_direction direction)
index 66d8ea68f40bdc2cd75e6c3fb47831de9cf6e8f7..4c98cc96971f0e1c057695212ef29de78493add1 100644 (file)
@@ -549,20 +549,6 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
        return dma_free_attrs(dev, size, cpu_addr, dma_handle, 0);
 }
 
-static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
-               dma_addr_t *dma_handle, gfp_t gfp)
-{
-       return dma_alloc_attrs(dev, size, dma_handle, gfp,
-                              DMA_ATTR_NON_CONSISTENT);
-}
-
-static inline void dma_free_noncoherent(struct device *dev, size_t size,
-               void *cpu_addr, dma_addr_t dma_handle)
-{
-       dma_free_attrs(dev, size, cpu_addr, dma_handle,
-                      DMA_ATTR_NON_CONSISTENT);
-}
-
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
        const struct dma_map_ops *ops = get_dma_ops(dev);