aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2012-03-27 08:56:04 -0400
committerMarek Szyprowski <m.szyprowski@samsung.com>2012-03-28 10:36:38 -0400
commit988624ec13e87680eb3eaa0f1e921fedd48b4ac4 (patch)
tree1a22dd795510c99404b0d623851eed3621435e2d /arch/microblaze/include/asm
parent552c0d3ea68df46646d1f0dfcbf92a133c4e792b (diff)
Microblaze: adapt for dma_map_ops changes
Adapt core Microblaze 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> [fixed coding style issues] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/microblaze/include/asm')
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index 3a3e5b886854..01d228286cb0 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -123,28 +123,34 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
123#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 123#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
124#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 124#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
125 125
126static inline void *dma_alloc_coherent(struct device *dev, size_t size, 126#define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
127 dma_addr_t *dma_handle, gfp_t flag) 127
128static inline void *dma_alloc_attrs(struct device *dev, size_t size,
129 dma_addr_t *dma_handle, gfp_t flag,
130 struct dma_attrs *attrs)
128{ 131{
129 struct dma_map_ops *ops = get_dma_ops(dev); 132 struct dma_map_ops *ops = get_dma_ops(dev);
130 void *memory; 133 void *memory;
131 134
132 BUG_ON(!ops); 135 BUG_ON(!ops);
133 136
134 memory = ops->alloc_coherent(dev, size, dma_handle, flag); 137 memory = ops->alloc(dev, size, dma_handle, flag, attrs);
135 138
136 debug_dma_alloc_coherent(dev, size, *dma_handle, memory); 139 debug_dma_alloc_coherent(dev, size, *dma_handle, memory);
137 return memory; 140 return memory;
138} 141}
139 142
140static inline void dma_free_coherent(struct device *dev, size_t size, 143#define dma_free_coherent(d,s,c,h) dma_free_attrs(d, s, c, h, NULL)
141 void *cpu_addr, dma_addr_t dma_handle) 144
145static inline void dma_free_attrs(struct device *dev, size_t size,
146 void *cpu_addr, dma_addr_t dma_handle,
147 struct dma_attrs *attrs)
142{ 148{
143 struct dma_map_ops *ops = get_dma_ops(dev); 149 struct dma_map_ops *ops = get_dma_ops(dev);
144 150
145 BUG_ON(!ops); 151 BUG_ON(!ops);
146 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); 152 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
147 ops->free_coherent(dev, size, cpu_addr, dma_handle); 153 ops->free(dev, size, cpu_addr, dma_handle, attrs);
148} 154}
149 155
150static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 156static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,