diff options
Diffstat (limited to 'arch/sparc/include/asm/dma-mapping.h')
-rw-r--r-- | arch/sparc/include/asm/dma-mapping.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 8c0e4f7bb204..48a7c65731d2 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h | |||
@@ -26,24 +26,30 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
26 | 26 | ||
27 | #include <asm-generic/dma-mapping-common.h> | 27 | #include <asm-generic/dma-mapping-common.h> |
28 | 28 | ||
29 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 29 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
30 | dma_addr_t *dma_handle, gfp_t flag) | 30 | |
31 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
32 | dma_addr_t *dma_handle, gfp_t flag, | ||
33 | struct dma_attrs *attrs) | ||
31 | { | 34 | { |
32 | struct dma_map_ops *ops = get_dma_ops(dev); | 35 | struct dma_map_ops *ops = get_dma_ops(dev); |
33 | void *cpu_addr; | 36 | void *cpu_addr; |
34 | 37 | ||
35 | cpu_addr = ops->alloc_coherent(dev, size, dma_handle, flag); | 38 | cpu_addr = ops->alloc(dev, size, dma_handle, flag, attrs); |
36 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); | 39 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); |
37 | return cpu_addr; | 40 | return cpu_addr; |
38 | } | 41 | } |
39 | 42 | ||
40 | static inline void dma_free_coherent(struct device *dev, size_t size, | 43 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
41 | void *cpu_addr, dma_addr_t dma_handle) | 44 | |
45 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
46 | void *cpu_addr, dma_addr_t dma_handle, | ||
47 | struct dma_attrs *attrs) | ||
42 | { | 48 | { |
43 | struct dma_map_ops *ops = get_dma_ops(dev); | 49 | struct dma_map_ops *ops = get_dma_ops(dev); |
44 | 50 | ||
45 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); | 51 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); |
46 | ops->free_coherent(dev, size, cpu_addr, dma_handle); | 52 | ops->free(dev, size, cpu_addr, dma_handle, attrs); |
47 | } | 53 | } |
48 | 54 | ||
49 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 55 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |