linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] m68k: Provide dma_alloc_attrs()/dma_free_attrs()
@ 2012-12-16 17:38 Geert Uytterhoeven
  2012-12-16 17:38 ` [PATCH 2/2] asm-generic/dma-mapping-broken.h: " Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2012-12-16 17:38 UTC (permalink / raw)
  To: linux-arch, Arnd Bergmann; +Cc: linux-m68k, linux-kernel, Geert Uytterhoeven

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>
---
 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 17f7a45..3e6b844 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,
 extern void dma_free_coherent(struct device *, size_t,
 			      void *, dma_addr_t);
 
+static inline void *dma_alloc_attrs(struct device *dev, size_t size,
+				    dma_addr_t *dma_handle, gfp_t flag,
+				    struct dma_attrs *attrs)
+{
+	/* attrs is not supported and ignored */
+	return dma_alloc_coherent(dev, size, dma_handle, flag);
+}
+
+static inline void dma_free_attrs(struct device *dev, size_t size,
+				  void *cpu_addr, dma_addr_t dma_handle,
+				  struct dma_attrs *attrs)
+{
+	/* attrs is not supported and ignored */
+	dma_free_coherent(dev, size, cpu_addr, dma_handle);
+}
+
 static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
 					  dma_addr_t *handle, gfp_t flag)
 {
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-22 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16 17:38 [PATCH 1/2] m68k: Provide dma_alloc_attrs()/dma_free_attrs() Geert Uytterhoeven
2012-12-16 17:38 ` [PATCH 2/2] asm-generic/dma-mapping-broken.h: " Geert Uytterhoeven
2012-12-16 17:38   ` Geert Uytterhoeven
2012-12-17 16:12   ` Arnd Bergmann
2012-12-22 12:51     ` Geert Uytterhoeven
2012-12-22 12:51       ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).