]> Pileus Git - ~andy/linux/commitdiff
sparc32: support leon + sun in dma_make_coherent()
authorSam Ravnborg <sam@ravnborg.org>
Sat, 26 May 2012 04:43:29 +0000 (04:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 May 2012 06:52:54 +0000 (23:52 -0700)
No need for two implementations - we check the cpu model.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Konrad Eisele <konrad@gaisler.com>
arch/sparc/kernel/ioport.c

index 8bc4db01af32fecc80da5153112c435a58362b37..f00945bed1b9fe4cd5b9476fa4803e1e4d4eb021 100644 (file)
@@ -55,17 +55,13 @@ const struct sparc32_dma_ops *sparc32_dma_ops;
 /* This function must make sure that caches and memory are coherent after DMA
  * On LEON systems without cache snooping it flushes the entire D-CACHE.
  */
-#ifndef CONFIG_SPARC_LEON
 static inline void dma_make_coherent(unsigned long pa, unsigned long len)
 {
+       if (sparc_cpu_model == sparc_leon) {
+               if (!sparc_leon3_snooping_enabled())
+                       leon_flush_dcache_all();
+       }
 }
-#else
-static inline void dma_make_coherent(unsigned long pa, unsigned long len)
-{
-       if (!sparc_leon3_snooping_enabled())
-               leon_flush_dcache_all();
-}
-#endif
 
 static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
 static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys,