Revert "dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops"
authorChristoph Hellwig <hch@lst.de>
Tue, 25 Sep 2018 20:16:55 +0000 (13:16 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 25 Sep 2018 22:12:26 +0000 (15:12 -0700)
This reverts commit 46053c73685411915d3de50c5a0045beef32806b.

This change breaks architectures setting up dma_ops in their own magic
way and not using arch_setup_dma_ops, so revert it.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/arm64/include/asm/dma-mapping.h
arch/arm64/mm/dma-mapping.c
include/linux/dma-mapping.h

index 0a2d133..b7847eb 100644 (file)
@@ -39,6 +39,11 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
                        const struct iommu_ops *iommu, bool coherent);
 #define arch_setup_dma_ops     arch_setup_dma_ops
 
+#ifdef CONFIG_IOMMU_DMA
+void arch_teardown_dma_ops(struct device *dev);
+#define arch_teardown_dma_ops  arch_teardown_dma_ops
+#endif
+
 /* do not use this function in a driver */
 static inline bool is_device_dma_coherent(struct device *dev)
 {
index cdcb73d..072c51f 100644 (file)
@@ -862,6 +862,11 @@ out_err:
                 dev_name(dev));
 }
 
+void arch_teardown_dma_ops(struct device *dev)
+{
+       dev->dma_ops = NULL;
+}
+
 #else
 
 static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
index bd81e74..d23fc45 100644 (file)
@@ -665,10 +665,7 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base,
 #endif
 
 #ifndef arch_teardown_dma_ops
-static inline void arch_teardown_dma_ops(struct device *dev)
-{
-       dev->dma_ops = NULL;
-}
+static inline void arch_teardown_dma_ops(struct device *dev) { }
 #endif
 
 static inline unsigned int dma_get_max_seg_size(struct device *dev)