]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/xtensa/include/asm/dma-mapping.h
dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent}
[karo-tx-linux.git] / arch / xtensa / include / asm / dma-mapping.h
index f01cb3044e50d310112a94abb597b8ac7aed1b35..bf24c908e5ff77edf7c5602bc09c794527e486dd 100644 (file)
@@ -34,37 +34,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
 #define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
-#define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
-#define dma_free_coherent(d, s, c, h) dma_free_attrs(d, s, c, h, NULL)
-
-static inline void *dma_alloc_attrs(struct device *dev, size_t size,
-                                   dma_addr_t *dma_handle, gfp_t gfp,
-                                   struct dma_attrs *attrs)
-{
-       void *ret;
-       struct dma_map_ops *ops = get_dma_ops(dev);
-
-       if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
-               return ret;
-
-       ret = ops->alloc(dev, size, dma_handle, gfp, attrs);
-       debug_dma_alloc_coherent(dev, size, *dma_handle, ret);
-
-       return ret;
-}
-
-static inline void dma_free_attrs(struct device *dev, size_t size,
-                                 void *vaddr, dma_addr_t dma_handle,
-                                 struct dma_attrs *attrs)
-{
-       struct dma_map_ops *ops = get_dma_ops(dev);
-
-       if (dma_release_from_coherent(dev, get_order(size), vaddr))
-               return;
-
-       ops->free(dev, size, vaddr, dma_handle, attrs);
-       debug_dma_free_coherent(dev, size, vaddr, dma_handle);
-}
 
 static inline int
 dma_mapping_error(struct device *dev, dma_addr_t dma_addr)