aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/pci-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/pci-dma.c')
-rw-r--r--arch/parisc/kernel/pci-dma.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 23c1388df1f5..41f8e321e34c 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -569,11 +569,10 @@ static void *fail_alloc_consistent(struct device *dev, size_t size,
569static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size, 569static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
570 dma_addr_t *dma_handle, gfp_t flag) 570 dma_addr_t *dma_handle, gfp_t flag)
571{ 571{
572 void *addr = NULL; 572 void *addr;
573 573
574 /* rely on kmalloc to be cacheline aligned */ 574 addr = (void *)__get_free_pages(flag, get_order(size));
575 addr = kmalloc(size, flag); 575 if (addr)
576 if(addr)
577 *dma_handle = (dma_addr_t)virt_to_phys(addr); 576 *dma_handle = (dma_addr_t)virt_to_phys(addr);
578 577
579 return addr; 578 return addr;
@@ -582,7 +581,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
582static void pa11_dma_free_noncoherent(struct device *dev, size_t size, 581static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
583 void *vaddr, dma_addr_t iova) 582 void *vaddr, dma_addr_t iova)
584{ 583{
585 kfree(vaddr); 584 free_pages((unsigned long)vaddr, get_order(size));
586 return; 585 return;
587} 586}
588 587