Skip to content

Commit 0e0d26e

Browse files
author
Christoph Hellwig
committed
xen/arm: remove xen_dma_ops
arm and arm64 can just use xen_swiotlb_dma_ops directly like x86, no need for a pointer indirection. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
1 parent efcd572 commit 0e0d26e

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎arch/arm/mm/dma-mapping.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <asm/mach/map.h>
3737
#include <asm/system_info.h>
3838
#include <asm/dma-contiguous.h>
39+
#include <xen/swiotlb-xen.h>
3940

4041
#include "dma.h"
4142
#include "mm.h"
@@ -2315,7 +2316,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
23152316

23162317
#ifdef CONFIG_XEN
23172318
if (xen_initial_domain())
2318-
dev->dma_ops = xen_dma_ops;
2319+
dev->dma_ops = &xen_swiotlb_dma_ops;
23192320
#endif
23202321
dev->archdata.dma_ops_setup = true;
23212322
}

‎arch/arm/xen/mm.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,12 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
162162
}
163163
EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region);
164164

165-
const struct dma_map_ops *xen_dma_ops;
166-
EXPORT_SYMBOL(xen_dma_ops);
167-
168165
int __init xen_mm_init(void)
169166
{
170167
struct gnttab_cache_flush cflush;
171168
if (!xen_initial_domain())
172169
return 0;
173170
xen_swiotlb_init(1, false);
174-
xen_dma_ops = &xen_swiotlb_dma_ops;
175171

176172
cflush.op = 0;
177173
cflush.a.dev_bus_addr = 0;

‎arch/arm64/mm/dma-mapping.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/cache.h>
99
#include <linux/dma-noncoherent.h>
1010
#include <linux/dma-iommu.h>
11+
#include <xen/swiotlb-xen.h>
1112

1213
#include <asm/cacheflush.h>
1314

@@ -52,6 +53,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
5253

5354
#ifdef CONFIG_XEN
5455
if (xen_initial_domain())
55-
dev->dma_ops = xen_dma_ops;
56+
dev->dma_ops = &xen_swiotlb_dma_ops;
5657
#endif
5758
}

‎include/xen/arm/hypervisor.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ static inline enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
1919
return PARAVIRT_LAZY_NONE;
2020
}
2121

22-
extern const struct dma_map_ops *xen_dma_ops;
23-
2422
#ifdef CONFIG_XEN
2523
void __init xen_early_init(void);
2624
#else

0 commit comments

Comments
 (0)