powerpc/dma: trim the fat from <asm/dma-mapping.h>
authorChristoph Hellwig <hch@lst.de>
Wed, 13 Feb 2019 07:01:33 +0000 (08:01 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 18 Feb 2019 11:41:04 +0000 (22:41 +1100)
There is no need to provide anything but get_arch_dma_ops to
<linux/dma-mapping.h>.  More the remaining declarations to <asm/iommu.h>
and drop all the includes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/dma-mapping.h
arch/powerpc/include/asm/iommu.h
arch/powerpc/platforms/44x/ppc476.c
arch/powerpc/platforms/85xx/corenet_generic.c
arch/powerpc/platforms/85xx/qemu_e500.c
arch/powerpc/sysdev/fsl_pci.c

index a59c42879194aacd01b42390391535ec3e55ce98..565d6f74b189cc23dc5b985915da97aedf2c6c09 100644 (file)
@@ -1,37 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2004 IBM
- *
- * Implements the generic device dma API for powerpc.
- * the pci and vio busses
  */
 #ifndef _ASM_DMA_MAPPING_H
 #define _ASM_DMA_MAPPING_H
-#ifdef __KERNEL__
-
-#include <linux/types.h>
-#include <linux/cache.h>
-/* need struct page definitions */
-#include <linux/mm.h>
-#include <linux/scatterlist.h>
-#include <linux/dma-debug.h>
-#include <asm/io.h>
-#include <asm/swiotlb.h>
-
-static inline unsigned long device_to_mask(struct device *dev)
-{
-       if (dev->dma_mask && *dev->dma_mask)
-               return *dev->dma_mask;
-       /* Assume devices without mask can take 32 bit addresses */
-       return 0xfffffffful;
-}
-
-/*
- * Available generic sets of operations
- */
-#ifdef CONFIG_PPC64
-extern const struct dma_map_ops dma_iommu_ops;
-#endif
 
 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 {
@@ -43,5 +15,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
        return NULL;
 }
 
-#endif /* __KERNEL__ */
 #endif /* _ASM_DMA_MAPPING_H */
index 6f00a892ebdf28fe337a74609b33f97c145cab32..0ac52392ed99d021af872f8a23a4527e2418576b 100644 (file)
@@ -325,5 +325,15 @@ extern bool iommu_fixed_is_weak;
 #define iommu_fixed_is_weak false
 #endif
 
+extern const struct dma_map_ops dma_iommu_ops;
+
+static inline unsigned long device_to_mask(struct device *dev)
+{
+       if (dev->dma_mask && *dev->dma_mask)
+               return *dev->dma_mask;
+       /* Assume devices without mask can take 32 bit addresses */
+       return 0xfffffffful;
+}
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_IOMMU_H */
index e55933f9cd55f9e6576cf6ff8c838bb949a47145..a5e61e5c16e27db4b9633c4058b0858f22f91821 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/ppc4xx.h>
 #include <asm/mpic.h>
 #include <asm/mmu.h>
+#include <asm/swiotlb.h>
 
 #include <linux/pci.h>
 #include <linux/i2c.h>
index 808da1e9c0a76ae48dc1b23a91b119ddadbedbf5..785e9641220da1dce6ca2fcec5a6fcf9343f65c7 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/udbg.h>
 #include <asm/mpic.h>
 #include <asm/ehv_pic.h>
+#include <asm/swiotlb.h>
 #include <soc/fsl/qe/qe_ic.h>
 
 #include <linux/of_platform.h>
index 27631c607f3d9a48308593ecfd4fceec873e57b6..c52c8f9e83852bf1c2ed55d3bb017daf0a71b64f 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/time.h>
 #include <asm/udbg.h>
 #include <asm/mpic.h>
+#include <asm/swiotlb.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 #include "smp.h"
index a04c6dde6ed0b551842006fed34743fde23a2a8e..f49aec251a5a0e7753dfa395f76f1e83b3797047 100644 (file)
@@ -40,6 +40,7 @@
 #include <asm/mpc85xx.h>
 #include <asm/disassemble.h>
 #include <asm/ppc-opcode.h>
+#include <asm/swiotlb.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>