diff options
Diffstat (limited to 'arch/arm/mm/consistent.c')
-rw-r--r-- | arch/arm/mm/consistent.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c index 333a82a3717e..db7b3e38ef1d 100644 --- a/arch/arm/mm/consistent.c +++ b/arch/arm/mm/consistent.c | |||
@@ -274,6 +274,11 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
274 | void * | 274 | void * |
275 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) | 275 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) |
276 | { | 276 | { |
277 | void *memory; | ||
278 | |||
279 | if (dma_alloc_from_coherent(dev, size, handle, &memory)) | ||
280 | return memory; | ||
281 | |||
277 | if (arch_is_coherent()) { | 282 | if (arch_is_coherent()) { |
278 | void *virt; | 283 | void *virt; |
279 | 284 | ||
@@ -362,6 +367,9 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr | |||
362 | 367 | ||
363 | WARN_ON(irqs_disabled()); | 368 | WARN_ON(irqs_disabled()); |
364 | 369 | ||
370 | if (dma_release_from_coherent(dev, get_order(size), cpu_addr)) | ||
371 | return; | ||
372 | |||
365 | if (arch_is_coherent()) { | 373 | if (arch_is_coherent()) { |
366 | kfree(cpu_addr); | 374 | kfree(cpu_addr); |
367 | return; | 375 | return; |