public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH 2/2] asm-generic/dma-mapping-broken.h: Provide dma_alloc_attrs()/dma_free_attrs()
       [not found] <1355679527-1207-1-git-send-email-geert@linux-m68k.org>
@ 2012-12-16 17:38 ` Geert Uytterhoeven
  2012-12-17 16:12   ` Arnd Bergmann
       [not found]   ` <201212171612.44126.arnd@arndb.de>
  0 siblings, 2 replies; 3+ 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 these are
dummy functions, we don't care.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 include/asm-generic/dma-mapping-broken.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
index ccf7b4f..6c32af9 100644
--- a/include/asm-generic/dma-mapping-broken.h
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -16,6 +16,22 @@ extern void
 dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
 		    dma_addr_t dma_handle);
 
+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);
+}
+
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
 
-- 
1.7.0.4

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

* Re: [PATCH 2/2] asm-generic/dma-mapping-broken.h: Provide dma_alloc_attrs()/dma_free_attrs()
  2012-12-16 17:38 ` [PATCH 2/2] asm-generic/dma-mapping-broken.h: Provide dma_alloc_attrs()/dma_free_attrs() Geert Uytterhoeven
@ 2012-12-17 16:12   ` Arnd Bergmann
       [not found]   ` <201212171612.44126.arnd@arndb.de>
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2012-12-17 16:12 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-arch, linux-m68k, linux-kernel

On Sunday 16 December 2012, Geert Uytterhoeven wrote:
> 
> 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 these are
> dummy functions, we don't care.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  include/asm-generic/dma-mapping-broken.h |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)

Acked-by: Arnd Bergmann <arnd@arndb.de>

Maybe you can put this one in your m68k tree along with your other
patch.

	Arnd

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

* Re: [PATCH 2/2] asm-generic/dma-mapping-broken.h: Provide dma_alloc_attrs()/dma_free_attrs()
       [not found]   ` <201212171612.44126.arnd@arndb.de>
@ 2012-12-22 12:51     ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2012-12-22 12:51 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, linux-m68k, linux-kernel

Hi Arnd,

On Mon, Dec 17, 2012 at 5:12 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Sunday 16 December 2012, Geert Uytterhoeven wrote:
>> 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 these are
>> dummy functions, we don't care.
>>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>>  include/asm-generic/dma-mapping-broken.h |   16 ++++++++++++++++
>>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

> Maybe you can put this one in your m68k tree along with your other
> patch.

Will do.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1355679527-1207-1-git-send-email-geert@linux-m68k.org>
2012-12-16 17:38 ` [PATCH 2/2] asm-generic/dma-mapping-broken.h: Provide dma_alloc_attrs()/dma_free_attrs() Geert Uytterhoeven
2012-12-17 16:12   ` Arnd Bergmann
     [not found]   ` <201212171612.44126.arnd@arndb.de>
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