@@ -13,6 +13,7 @@
#define DMA_ERROR_CODE (~0)
extern struct dma_map_ops arm_dma_ops;
+extern struct dma_map_ops arm_iommu_ops;
static inline struct dma_map_ops *get_dma_ops(struct device *dev)
{
@@ -1567,7 +1567,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
__dma_page_cpu_to_dev(page, offset, size, dir);
}
-struct dma_map_ops iommu_ops = {
+struct dma_map_ops arm_iommu_ops = {
.alloc = arm_iommu_alloc_attrs,
.free = arm_iommu_free_attrs,
.mmap = arm_iommu_mmap_attrs,
@@ -1582,6 +1582,7 @@ struct dma_map_ops iommu_ops = {
.sync_sg_for_cpu = arm_iommu_sync_sg_for_cpu,
.sync_sg_for_device = arm_iommu_sync_sg_for_device,
};
+EXPORT_SYMBOL(arm_iommu_ops);
/**
* arm_iommu_create_mapping
@@ -1674,7 +1675,7 @@ int arm_iommu_attach_device(struct device *dev,
kref_get(&mapping->kref);
dev->archdata.mapping = mapping;
- set_dma_ops(dev, &iommu_ops);
+ set_dma_ops(dev, &arm_iommu_ops);
pr_info("Attached IOMMU controller to %s device.\n", dev_name(dev));
return 0;
This patch renames the dma_ops structure for arm from iommu_ops to arm_iommu_ops. This structure is also exported and declared extern so that it can be set as any device's dma ops directly. Signed-off-by: Prathyush K <prathyush.k@samsung.com> --- arch/arm/include/asm/dma-mapping.h | 1 + arch/arm/mm/dma-mapping.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)