diff options
Diffstat (limited to 'arch/microblaze/mm/consistent.c')
| -rw-r--r-- | arch/microblaze/mm/consistent.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c index 5a59dad62bd..e10ad930895 100644 --- a/arch/microblaze/mm/consistent.c +++ b/arch/microblaze/mm/consistent.c @@ -13,7 +13,7 @@ * published by the Free Software Foundation. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/kernel.h> @@ -37,7 +37,7 @@ #include <asm/pgalloc.h> #include <linux/io.h> #include <linux/hardirq.h> -#include <asm/mmu_context.h> +#include <linux/mmu_context.h> #include <asm/mmu.h> #include <linux/uaccess.h> #include <asm/pgtable.h> @@ -59,7 +59,7 @@ * uncached region. This will no doubt cause big problems if memory allocated * here is not also freed properly. -- JW */ -void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) +void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) { unsigned long order, vaddr; void *ret; @@ -102,8 +102,7 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) # endif if ((unsigned int)ret > cpuinfo.dcache_base && (unsigned int)ret < cpuinfo.dcache_high) - printk(KERN_WARNING - "ERROR: Your cache coherent area is CACHED!!!\n"); + pr_warn("ERROR: Your cache coherent area is CACHED!!!\n"); /* dma_handle is same as physical (shadowed) address */ *dma_handle = (dma_addr_t)ret; @@ -118,7 +117,7 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) ret = (void *)va; /* This gives us the real physical address of the first page. */ - *dma_handle = pa = virt_to_bus((void *)vaddr); + *dma_handle = pa = __virt_to_phys(vaddr); #endif /* @@ -177,8 +176,7 @@ void consistent_free(size_t size, void *vaddr) page = virt_to_page(vaddr); do { - ClearPageReserved(page); - __free_page(page); + __free_reserved_page(page); page++; } while (size -= PAGE_SIZE); #else @@ -195,9 +193,7 @@ void consistent_free(size_t size, void *vaddr) pte_clear(&init_mm, (unsigned int)vaddr, ptep); if (pfn_valid(pfn)) { page = pfn_to_page(pfn); - - ClearPageReserved(page); - __free_page(page); + __free_reserved_page(page); } } vaddr += PAGE_SIZE; |
