aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/kernel/dma.c')
-rw-r--r--arch/microblaze/kernel/dma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
index b1084974fccd..9dcd90b5df55 100644
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -8,6 +8,7 @@
8 8
9#include <linux/device.h> 9#include <linux/device.h>
10#include <linux/dma-mapping.h> 10#include <linux/dma-mapping.h>
11#include <linux/gfp.h>
11#include <linux/dma-debug.h> 12#include <linux/dma-debug.h>
12#include <asm/bug.h> 13#include <asm/bug.h>
13#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
@@ -37,7 +38,7 @@ static inline void __dma_sync_page(unsigned long paddr, unsigned long offset,
37 38
38static unsigned long get_dma_direct_offset(struct device *dev) 39static unsigned long get_dma_direct_offset(struct device *dev)
39{ 40{
40 if (dev) 41 if (likely(dev))
41 return (unsigned long)dev->archdata.dma_data; 42 return (unsigned long)dev->archdata.dma_data;
42 43
43 return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */ 44 return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */
@@ -73,7 +74,7 @@ static void dma_direct_free_coherent(struct device *dev, size_t size,
73 void *vaddr, dma_addr_t dma_handle) 74 void *vaddr, dma_addr_t dma_handle)
74{ 75{
75#ifdef NOT_COHERENT_CACHE 76#ifdef NOT_COHERENT_CACHE
76 consistent_free(vaddr); 77 consistent_free(size, vaddr);
77#else 78#else
78 free_pages((unsigned long)vaddr, get_order(size)); 79 free_pages((unsigned long)vaddr, get_order(size));
79#endif 80#endif