Commit 1a0afc14 authored by Christoph Hellwig's avatar Christoph Hellwig

Revert "dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops"

This reverts commit 46053c73.

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: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 9406a49f
...@@ -39,6 +39,11 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, ...@@ -39,6 +39,11 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
const struct iommu_ops *iommu, bool coherent); const struct iommu_ops *iommu, bool coherent);
#define arch_setup_dma_ops arch_setup_dma_ops #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 */ /* do not use this function in a driver */
static inline bool is_device_dma_coherent(struct device *dev) static inline bool is_device_dma_coherent(struct device *dev)
{ {
......
...@@ -862,6 +862,11 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, ...@@ -862,6 +862,11 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
dev_name(dev)); dev_name(dev));
} }
void arch_teardown_dma_ops(struct device *dev)
{
dev->dma_ops = NULL;
}
#else #else
static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
......
...@@ -665,10 +665,7 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, ...@@ -665,10 +665,7 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base,
#endif #endif
#ifndef arch_teardown_dma_ops #ifndef arch_teardown_dma_ops
static inline void arch_teardown_dma_ops(struct device *dev) static inline void arch_teardown_dma_ops(struct device *dev) { }
{
dev->dma_ops = NULL;
}
#endif #endif
static inline unsigned int dma_get_max_seg_size(struct device *dev) static inline unsigned int dma_get_max_seg_size(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment