diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2012-12-16 12:27:33 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2012-12-25 14:14:53 -0500 |
commit | 4a09ab6771276a7fd3f80be4250a0fd0ba5114ad (patch) | |
tree | c574174e339f0b8ed2be79777201e1f0a4a84bad /arch/m68k | |
parent | a49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff) |
m68k: Provide dma_alloc_attrs()/dma_free_attrs()
Since commit 0049fb2603b7afb1080776ee691dfa5a3d282357 ("OMAPFB: use
dma_alloc_attrs to allocate memory") we have one non-arch user of
dma_{alloc,free}_attrs().
Hence provide these functions, as wrappers around
dma_{alloc,free}_coherent().
Note that most architectures do it the other way around. But as so far
m68k doesn't support the attributes at all, our solution should generate
smaller code.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/include/asm/dma-mapping.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h index 17f7a45948ea..3e6b8445af6a 100644 --- a/arch/m68k/include/asm/dma-mapping.h +++ b/arch/m68k/include/asm/dma-mapping.h | |||
@@ -21,6 +21,22 @@ extern void *dma_alloc_coherent(struct device *, size_t, | |||
21 | extern void dma_free_coherent(struct device *, size_t, | 21 | extern void dma_free_coherent(struct device *, size_t, |
22 | void *, dma_addr_t); | 22 | void *, dma_addr_t); |
23 | 23 | ||
24 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
25 | dma_addr_t *dma_handle, gfp_t flag, | ||
26 | struct dma_attrs *attrs) | ||
27 | { | ||
28 | /* attrs is not supported and ignored */ | ||
29 | return dma_alloc_coherent(dev, size, dma_handle, flag); | ||
30 | } | ||
31 | |||
32 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
33 | void *cpu_addr, dma_addr_t dma_handle, | ||
34 | struct dma_attrs *attrs) | ||
35 | { | ||
36 | /* attrs is not supported and ignored */ | ||
37 | dma_free_coherent(dev, size, cpu_addr, dma_handle); | ||
38 | } | ||
39 | |||
24 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, | 40 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, |
25 | dma_addr_t *handle, gfp_t flag) | 41 | dma_addr_t *handle, gfp_t flag) |
26 | { | 42 | { |