Skip to contentSkip to conversation

arm: Move the definition of ARCH_HAS_DMA_MMAP_COHERENT where it belongs

PATCH Benjamin Herrenschmidt 2 participants 2 messages Mar 25, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Something I noticed while implementing dma_mmap_coherent() for powerpc...

---
 arch/arm/include/asm/dma-mapping.h |    2 +-
 sound/core/pcm_native.c            |    7 -------
 2 files changed, 1 insertions(+), 8 deletions(-)
arch/arm/include/asm/dma-mapping.h +1 -1
index 4fff837..ed33eab 100644
@@ -214,7 +214,7 @@ extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t);
  */
 int dma_mmap_coherent(struct device *, struct vm_area_struct *,
 		void *, dma_addr_t, size_t);
-
+#define ARCH_HAS_DMA_MMAP_COHERENT
 
 /**
  * dma_alloc_writecombine - allocate writecombining memory for DMA
sound/core/pcm_native.c +0 -7
index ae42b65..2d99c37 100644
@@ -3145,13 +3145,6 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = {
 	.fault =	snd_pcm_mmap_data_fault,
 };
 
-#ifndef ARCH_HAS_DMA_MMAP_COHERENT
-/* This should be defined / handled globally! */
-#ifdef CONFIG_ARM
-#define ARCH_HAS_DMA_MMAP_COHERENT
-#endif
-#endif
-
 /*
  * mmap the DMA buffer on RAM
  */
Acked-by
#1 lore raw

At Fri, 25 Mar 2011 17:47:50 +1100,

Quoted 4 lines · Benjamin Herrenschmidt

Something I noticed while implementing dma_mmap_coherent() for powerpc...

Thanks for catching up!

Takashi

Quoted 39 lines
---
 arch/arm/include/asm/dma-mapping.h |    2 +-
 sound/core/pcm_native.c            |    7 -------
 2 files changed, 1 insertions(+), 8 deletions(-)
arch/arm/include/asm/dma-mapping.h +1 -1
index 4fff837..ed33eab 100644
@@ -214,7 +214,7 @@ extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t);
  */
 int dma_mmap_coherent(struct device *, struct vm_area_struct *,
 		void *, dma_addr_t, size_t);
-
+#define ARCH_HAS_DMA_MMAP_COHERENT
 
 /**
  * dma_alloc_writecombine - allocate writecombining memory for DMA
sound/core/pcm_native.c +0 -7
index ae42b65..2d99c37 100644
@@ -3145,13 +3145,6 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = {
 	.fault =	snd_pcm_mmap_data_fault,
 };
 
-#ifndef ARCH_HAS_DMA_MMAP_COHERENT
-/* This should be defined / handled globally! */
-#ifdef CONFIG_ARM
-#define ARCH_HAS_DMA_MMAP_COHERENT
-#endif
-#endif
-
 /*
  * mmap the DMA buffer on RAM
  */