diff options
-rw-r--r-- | arch/avr32/mm/dma-coherent.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/avr32/mm/dma-coherent.c b/arch/avr32/mm/dma-coherent.c index b68d669f823d..099212d4567c 100644 --- a/arch/avr32/mm/dma-coherent.c +++ b/arch/avr32/mm/dma-coherent.c | |||
@@ -112,16 +112,21 @@ void dma_free_coherent(struct device *dev, size_t size, | |||
112 | } | 112 | } |
113 | EXPORT_SYMBOL(dma_free_coherent); | 113 | EXPORT_SYMBOL(dma_free_coherent); |
114 | 114 | ||
115 | #if 0 | ||
116 | void *dma_alloc_writecombine(struct device *dev, size_t size, | 115 | void *dma_alloc_writecombine(struct device *dev, size_t size, |
117 | dma_addr_t *handle, gfp_t gfp) | 116 | dma_addr_t *handle, gfp_t gfp) |
118 | { | 117 | { |
119 | struct page *page; | 118 | struct page *page; |
119 | dma_addr_t phys; | ||
120 | 120 | ||
121 | page = __dma_alloc(dev, size, handle, gfp); | 121 | page = __dma_alloc(dev, size, handle, gfp); |
122 | if (!page) | ||
123 | return NULL; | ||
124 | |||
125 | phys = page_to_phys(page); | ||
126 | *handle = phys; | ||
122 | 127 | ||
123 | /* Now, map the page into P3 with write-combining turned on */ | 128 | /* Now, map the page into P3 with write-combining turned on */ |
124 | return __ioremap(page_to_phys(page), size, _PAGE_BUFFER); | 129 | return __ioremap(phys, size, _PAGE_BUFFER); |
125 | } | 130 | } |
126 | EXPORT_SYMBOL(dma_alloc_writecombine); | 131 | EXPORT_SYMBOL(dma_alloc_writecombine); |
127 | 132 | ||
@@ -132,8 +137,7 @@ void dma_free_writecombine(struct device *dev, size_t size, | |||
132 | 137 | ||
133 | iounmap(cpu_addr); | 138 | iounmap(cpu_addr); |
134 | 139 | ||
135 | page = bus_to_page(handle); | 140 | page = phys_to_page(handle); |
136 | __dma_free(dev, size, page, handle); | 141 | __dma_free(dev, size, page, handle); |
137 | } | 142 | } |
138 | EXPORT_SYMBOL(dma_free_writecombine); | 143 | EXPORT_SYMBOL(dma_free_writecombine); |
139 | #endif | ||