aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/dma-mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r--arch/arm/mm/dma-mapping.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 6ffdf17e0d5c..e309a5e2c935 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -180,7 +180,7 @@ static void arm_dma_sync_single_for_device(struct device *dev,
180 __dma_page_cpu_to_dev(page, offset, size, dir); 180 __dma_page_cpu_to_dev(page, offset, size, dir);
181} 181}
182 182
183struct dma_map_ops arm_dma_ops = { 183const struct dma_map_ops arm_dma_ops = {
184 .alloc = arm_dma_alloc, 184 .alloc = arm_dma_alloc,
185 .free = arm_dma_free, 185 .free = arm_dma_free,
186 .mmap = arm_dma_mmap, 186 .mmap = arm_dma_mmap,
@@ -204,7 +204,7 @@ static int arm_coherent_dma_mmap(struct device *dev, struct vm_area_struct *vma,
204 void *cpu_addr, dma_addr_t dma_addr, size_t size, 204 void *cpu_addr, dma_addr_t dma_addr, size_t size,
205 unsigned long attrs); 205 unsigned long attrs);
206 206
207struct dma_map_ops arm_coherent_dma_ops = { 207const struct dma_map_ops arm_coherent_dma_ops = {
208 .alloc = arm_coherent_dma_alloc, 208 .alloc = arm_coherent_dma_alloc,
209 .free = arm_coherent_dma_free, 209 .free = arm_coherent_dma_free,
210 .mmap = arm_coherent_dma_mmap, 210 .mmap = arm_coherent_dma_mmap,
@@ -1069,7 +1069,7 @@ static void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
1069int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 1069int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1070 enum dma_data_direction dir, unsigned long attrs) 1070 enum dma_data_direction dir, unsigned long attrs)
1071{ 1071{
1072 struct dma_map_ops *ops = get_dma_ops(dev); 1072 const struct dma_map_ops *ops = get_dma_ops(dev);
1073 struct scatterlist *s; 1073 struct scatterlist *s;
1074 int i, j; 1074 int i, j;
1075 1075
@@ -1103,7 +1103,7 @@ int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1103void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, 1103void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1104 enum dma_data_direction dir, unsigned long attrs) 1104 enum dma_data_direction dir, unsigned long attrs)
1105{ 1105{
1106 struct dma_map_ops *ops = get_dma_ops(dev); 1106 const struct dma_map_ops *ops = get_dma_ops(dev);
1107 struct scatterlist *s; 1107 struct scatterlist *s;
1108 1108
1109 int i; 1109 int i;
@@ -1122,7 +1122,7 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1122void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, 1122void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
1123 int nents, enum dma_data_direction dir) 1123 int nents, enum dma_data_direction dir)
1124{ 1124{
1125 struct dma_map_ops *ops = get_dma_ops(dev); 1125 const struct dma_map_ops *ops = get_dma_ops(dev);
1126 struct scatterlist *s; 1126 struct scatterlist *s;
1127 int i; 1127 int i;
1128 1128
@@ -1141,7 +1141,7 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
1141void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, 1141void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
1142 int nents, enum dma_data_direction dir) 1142 int nents, enum dma_data_direction dir)
1143{ 1143{
1144 struct dma_map_ops *ops = get_dma_ops(dev); 1144 const struct dma_map_ops *ops = get_dma_ops(dev);
1145 struct scatterlist *s; 1145 struct scatterlist *s;
1146 int i; 1146 int i;
1147 1147
@@ -2101,7 +2101,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
2101 __dma_page_cpu_to_dev(page, offset, size, dir); 2101 __dma_page_cpu_to_dev(page, offset, size, dir);
2102} 2102}
2103 2103
2104struct dma_map_ops iommu_ops = { 2104const struct dma_map_ops iommu_ops = {
2105 .alloc = arm_iommu_alloc_attrs, 2105 .alloc = arm_iommu_alloc_attrs,
2106 .free = arm_iommu_free_attrs, 2106 .free = arm_iommu_free_attrs,
2107 .mmap = arm_iommu_mmap_attrs, 2107 .mmap = arm_iommu_mmap_attrs,
@@ -2121,7 +2121,7 @@ struct dma_map_ops iommu_ops = {
2121 .unmap_resource = arm_iommu_unmap_resource, 2121 .unmap_resource = arm_iommu_unmap_resource,
2122}; 2122};
2123 2123
2124struct dma_map_ops iommu_coherent_ops = { 2124const struct dma_map_ops iommu_coherent_ops = {
2125 .alloc = arm_coherent_iommu_alloc_attrs, 2125 .alloc = arm_coherent_iommu_alloc_attrs,
2126 .free = arm_coherent_iommu_free_attrs, 2126 .free = arm_coherent_iommu_free_attrs,
2127 .mmap = arm_coherent_iommu_mmap_attrs, 2127 .mmap = arm_coherent_iommu_mmap_attrs,
@@ -2321,7 +2321,7 @@ void arm_iommu_detach_device(struct device *dev)
2321} 2321}
2322EXPORT_SYMBOL_GPL(arm_iommu_detach_device); 2322EXPORT_SYMBOL_GPL(arm_iommu_detach_device);
2323 2323
2324static struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent) 2324static const struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent)
2325{ 2325{
2326 return coherent ? &iommu_coherent_ops : &iommu_ops; 2326 return coherent ? &iommu_coherent_ops : &iommu_ops;
2327} 2327}
@@ -2376,7 +2376,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { }
2376 2376
2377#endif /* CONFIG_ARM_DMA_USE_IOMMU */ 2377#endif /* CONFIG_ARM_DMA_USE_IOMMU */
2378 2378
2379static struct dma_map_ops *arm_get_dma_map_ops(bool coherent) 2379static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
2380{ 2380{
2381 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops; 2381 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;
2382} 2382}
@@ -2384,7 +2384,7 @@ static struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
2384void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, 2384void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
2385 const struct iommu_ops *iommu, bool coherent) 2385 const struct iommu_ops *iommu, bool coherent)
2386{ 2386{
2387 struct dma_map_ops *dma_ops; 2387 const struct dma_map_ops *dma_ops;
2388 2388
2389 dev->archdata.dma_coherent = coherent; 2389 dev->archdata.dma_coherent = coherent;
2390 if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu)) 2390 if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu))