diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2012-03-27 08:32:21 -0400 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-03-28 10:36:32 -0400 |
commit | e8d51e54ab4020d984dda471ca077c7fed094326 (patch) | |
tree | 874f1d1ad6a1ab0aa28559062b0a27743bf5be97 /arch/mips/include | |
parent | baa676fcf8d555269bd0a5a2496782beee55824d (diff) |
MIPS: adapt for dma_map_ops changes
Adapt core MIPS architecture code for dma_map_ops changes: replace
alloc/free_coherent with generic alloc/free methods.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
[added missing changes to arch/mips/cavium-octeon/dma-octeon.c,
fixed attrs argument in dma-mapping.h]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/dma-mapping.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index 7aa37ddfca4b..be39a12901c6 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h | |||
@@ -57,25 +57,31 @@ dma_set_mask(struct device *dev, u64 mask) | |||
57 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 57 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
58 | enum dma_data_direction direction); | 58 | enum dma_data_direction direction); |
59 | 59 | ||
60 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 60 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
61 | dma_addr_t *dma_handle, gfp_t gfp) | 61 | |
62 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
63 | dma_addr_t *dma_handle, gfp_t gfp, | ||
64 | struct dma_attrs *attrs) | ||
62 | { | 65 | { |
63 | void *ret; | 66 | void *ret; |
64 | struct dma_map_ops *ops = get_dma_ops(dev); | 67 | struct dma_map_ops *ops = get_dma_ops(dev); |
65 | 68 | ||
66 | ret = ops->alloc_coherent(dev, size, dma_handle, gfp); | 69 | ret = ops->alloc(dev, size, dma_handle, gfp, attrs); |
67 | 70 | ||
68 | debug_dma_alloc_coherent(dev, size, *dma_handle, ret); | 71 | debug_dma_alloc_coherent(dev, size, *dma_handle, ret); |
69 | 72 | ||
70 | return ret; | 73 | return ret; |
71 | } | 74 | } |
72 | 75 | ||
73 | static inline void dma_free_coherent(struct device *dev, size_t size, | 76 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
74 | void *vaddr, dma_addr_t dma_handle) | 77 | |
78 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
79 | void *vaddr, dma_addr_t dma_handle, | ||
80 | struct dma_attrs *attrs) | ||
75 | { | 81 | { |
76 | struct dma_map_ops *ops = get_dma_ops(dev); | 82 | struct dma_map_ops *ops = get_dma_ops(dev); |
77 | 83 | ||
78 | ops->free_coherent(dev, size, vaddr, dma_handle); | 84 | ops->free(dev, size, vaddr, dma_handle, attrs); |
79 | 85 | ||
80 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); | 86 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); |
81 | } | 87 | } |