summaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 21:19:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 21:19:42 -0400
commit33e247c7e58d335d70ecb84fd869091e2e4b8dcb (patch)
treee8561e1993dff03f8e56d10a5795fe9d379a3390 /arch/microblaze
parentd71fc239b6915a8b750e9a447311029ff45b6580 (diff)
parent452e06af1f0149b01201f94264d452cd7a95db7a (diff)
Merge branch 'akpm' (patches from Andrew)
Merge third patch-bomb from Andrew Morton: - even more of the rest of MM - lib/ updates - checkpatch updates - small changes to a few scruffy filesystems - kmod fixes/cleanups - kexec updates - a dma-mapping cleanup series from hch * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (81 commits) dma-mapping: consolidate dma_set_mask dma-mapping: consolidate dma_supported dma-mapping: cosolidate dma_mapping_error dma-mapping: consolidate dma_{alloc,free}_noncoherent dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent} mm: use vma_is_anonymous() in create_huge_pmd() and wp_huge_pmd() mm: make sure all file VMAs have ->vm_ops set mm, mpx: add "vm_flags_t vm_flags" arg to do_mmap_pgoff() mm: mark most vm_operations_struct const namei: fix warning while make xmldocs caused by namei.c ipc: convert invalid scenarios to use WARN_ON zlib_deflate/deftree: remove bi_reverse() lib/decompress_unlzma: Do a NULL check for pointer lib/decompressors: use real out buf size for gunzip with kernel fs/affs: make root lookup from blkdev logical size sysctl: fix int -> unsigned long assignments in INT_MIN case kexec: export KERNEL_IMAGE_SIZE to vmcoreinfo kexec: align crash_notes allocation to make it be inside one physical page kexec: remove unnecessary test in kimage_alloc_crash_control_pages() kexec: split kexec_load syscall from kexec core code ...
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index ab353723076a..24b12970c9cf 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -27,7 +27,6 @@
27#include <linux/dma-debug.h> 27#include <linux/dma-debug.h>
28#include <linux/dma-attrs.h> 28#include <linux/dma-attrs.h>
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm-generic/dma-coherent.h>
31#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
32 31
33#define DMA_ERROR_CODE (~(dma_addr_t)0x0) 32#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
@@ -45,31 +44,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
45 return &dma_direct_ops; 44 return &dma_direct_ops;
46} 45}
47 46
48static inline int dma_supported(struct device *dev, u64 mask)
49{
50 struct dma_map_ops *ops = get_dma_ops(dev);
51
52 if (unlikely(!ops))
53 return 0;
54 if (!ops->dma_supported)
55 return 1;
56 return ops->dma_supported(dev, mask);
57}
58
59static inline int dma_set_mask(struct device *dev, u64 dma_mask)
60{
61 struct dma_map_ops *ops = get_dma_ops(dev);
62
63 if (unlikely(ops == NULL))
64 return -EIO;
65 if (ops->set_dma_mask)
66 return ops->set_dma_mask(dev, dma_mask);
67 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
68 return -EIO;
69 *dev->dma_mask = dma_mask;
70 return 0;
71}
72
73#include <asm-generic/dma-mapping-common.h> 47#include <asm-generic/dma-mapping-common.h>
74 48
75static inline void __dma_sync(unsigned long paddr, 49static inline void __dma_sync(unsigned long paddr,
@@ -88,50 +62,6 @@ static inline void __dma_sync(unsigned long paddr,
88 } 62 }
89} 63}
90 64
91static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
92{
93 struct dma_map_ops *ops = get_dma_ops(dev);
94
95 debug_dma_mapping_error(dev, dma_addr);
96 if (ops->mapping_error)
97 return ops->mapping_error(dev, dma_addr);
98
99 return (dma_addr == DMA_ERROR_CODE);
100}
101
102#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
103#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
104
105#define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
106
107static inline void *dma_alloc_attrs(struct device *dev, size_t size,
108 dma_addr_t *dma_handle, gfp_t flag,
109 struct dma_attrs *attrs)
110{
111 struct dma_map_ops *ops = get_dma_ops(dev);
112 void *memory;
113
114 BUG_ON(!ops);
115
116 memory = ops->alloc(dev, size, dma_handle, flag, attrs);
117
118 debug_dma_alloc_coherent(dev, size, *dma_handle, memory);
119 return memory;
120}
121
122#define dma_free_coherent(d,s,c,h) dma_free_attrs(d, s, c, h, NULL)
123
124static inline void dma_free_attrs(struct device *dev, size_t size,
125 void *cpu_addr, dma_addr_t dma_handle,
126 struct dma_attrs *attrs)
127{
128 struct dma_map_ops *ops = get_dma_ops(dev);
129
130 BUG_ON(!ops);
131 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
132 ops->free(dev, size, cpu_addr, dma_handle, attrs);
133}
134
135static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 65static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
136 enum dma_data_direction direction) 66 enum dma_data_direction direction)
137{ 67{