aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 09bd3b290bb8..98940d1392cb 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -117,7 +117,7 @@ const struct iommu_ops amd_iommu_ops;
117static ATOMIC_NOTIFIER_HEAD(ppr_notifier); 117static ATOMIC_NOTIFIER_HEAD(ppr_notifier);
118int amd_iommu_max_glx_val = -1; 118int amd_iommu_max_glx_val = -1;
119 119
120static struct dma_map_ops amd_iommu_dma_ops; 120static const struct dma_map_ops amd_iommu_dma_ops;
121 121
122/* 122/*
123 * This struct contains device specific data for the IOMMU 123 * This struct contains device specific data for the IOMMU
@@ -519,7 +519,7 @@ static void iommu_uninit_device(struct device *dev)
519 iommu_group_remove_device(dev); 519 iommu_group_remove_device(dev);
520 520
521 /* Remove dma-ops */ 521 /* Remove dma-ops */
522 dev->archdata.dma_ops = NULL; 522 dev->dma_ops = NULL;
523 523
524 /* 524 /*
525 * We keep dev_data around for unplugged devices and reuse it when the 525 * We keep dev_data around for unplugged devices and reuse it when the
@@ -2168,7 +2168,7 @@ static int amd_iommu_add_device(struct device *dev)
2168 dev_name(dev)); 2168 dev_name(dev));
2169 2169
2170 iommu_ignore_device(dev); 2170 iommu_ignore_device(dev);
2171 dev->archdata.dma_ops = &nommu_dma_ops; 2171 dev->dma_ops = &nommu_dma_ops;
2172 goto out; 2172 goto out;
2173 } 2173 }
2174 init_iommu_group(dev); 2174 init_iommu_group(dev);
@@ -2185,7 +2185,7 @@ static int amd_iommu_add_device(struct device *dev)
2185 if (domain->type == IOMMU_DOMAIN_IDENTITY) 2185 if (domain->type == IOMMU_DOMAIN_IDENTITY)
2186 dev_data->passthrough = true; 2186 dev_data->passthrough = true;
2187 else 2187 else
2188 dev->archdata.dma_ops = &amd_iommu_dma_ops; 2188 dev->dma_ops = &amd_iommu_dma_ops;
2189 2189
2190out: 2190out:
2191 iommu_completion_wait(iommu); 2191 iommu_completion_wait(iommu);
@@ -2732,7 +2732,7 @@ static int amd_iommu_dma_supported(struct device *dev, u64 mask)
2732 return check_device(dev); 2732 return check_device(dev);
2733} 2733}
2734 2734
2735static struct dma_map_ops amd_iommu_dma_ops = { 2735static const struct dma_map_ops amd_iommu_dma_ops = {
2736 .alloc = alloc_coherent, 2736 .alloc = alloc_coherent,
2737 .free = free_coherent, 2737 .free = free_coherent,
2738 .map_page = map_page, 2738 .map_page = map_page,