diff options
Diffstat (limited to 'arch/mips/mm/dma-default.c')
-rw-r--r-- | arch/mips/mm/dma-default.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 7e48e76148aa..9367e33fbd18 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
@@ -90,6 +90,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size, | |||
90 | { | 90 | { |
91 | void *ret; | 91 | void *ret; |
92 | 92 | ||
93 | if (dma_alloc_from_coherent(dev, size, dma_handle, &ret)) | ||
94 | return ret; | ||
95 | |||
93 | gfp = massage_gfp_flags(dev, gfp); | 96 | gfp = massage_gfp_flags(dev, gfp); |
94 | 97 | ||
95 | ret = (void *) __get_free_pages(gfp, get_order(size)); | 98 | ret = (void *) __get_free_pages(gfp, get_order(size)); |
@@ -122,6 +125,10 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
122 | dma_addr_t dma_handle) | 125 | dma_addr_t dma_handle) |
123 | { | 126 | { |
124 | unsigned long addr = (unsigned long) vaddr; | 127 | unsigned long addr = (unsigned long) vaddr; |
128 | int order = get_order(size); | ||
129 | |||
130 | if (dma_release_from_coherent(dev, order, vaddr)) | ||
131 | return; | ||
125 | 132 | ||
126 | plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); | 133 | plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); |
127 | 134 | ||