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 ab7710002ba6..d26fe1a35687 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,
@@ -1067,7 +1067,7 @@ static void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
1067int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 1067int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1068 enum dma_data_direction dir, unsigned long attrs) 1068 enum dma_data_direction dir, unsigned long attrs)
1069{ 1069{
1070 struct dma_map_ops *ops = get_dma_ops(dev); 1070 const struct dma_map_ops *ops = get_dma_ops(dev);
1071 struct scatterlist *s; 1071 struct scatterlist *s;
1072 int i, j; 1072 int i, j;
1073 1073
@@ -1101,7 +1101,7 @@ int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1101void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, 1101void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1102 enum dma_data_direction dir, unsigned long attrs) 1102 enum dma_data_direction dir, unsigned long attrs)
1103{ 1103{
1104 struct dma_map_ops *ops = get_dma_ops(dev); 1104 const struct dma_map_ops *ops = get_dma_ops(dev);
1105 struct scatterlist *s; 1105 struct scatterlist *s;
1106 1106
1107 int i; 1107 int i;
@@ -1120,7 +1120,7 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1120void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, 1120void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
1121 int nents, enum dma_data_direction dir) 1121 int nents, enum dma_data_direction dir)
1122{ 1122{
1123 struct dma_map_ops *ops = get_dma_ops(dev); 1123 const struct dma_map_ops *ops = get_dma_ops(dev);
1124 struct scatterlist *s; 1124 struct scatterlist *s;
1125 int i; 1125 int i;
1126 1126
@@ -1139,7 +1139,7 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
1139void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, 1139void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
1140 int nents, enum dma_data_direction dir) 1140 int nents, enum dma_data_direction dir)
1141{ 1141{
1142 struct dma_map_ops *ops = get_dma_ops(dev); 1142 const struct dma_map_ops *ops = get_dma_ops(dev);
1143 struct scatterlist *s; 1143 struct scatterlist *s;
1144 int i; 1144 int i;
1145 1145
@@ -2099,7 +2099,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
2099 __dma_page_cpu_to_dev(page, offset, size, dir); 2099 __dma_page_cpu_to_dev(page, offset, size, dir);
2100} 2100}
2101 2101
2102struct dma_map_ops iommu_ops = { 2102const struct dma_map_ops iommu_ops = {
2103 .alloc = arm_iommu_alloc_attrs, 2103 .alloc = arm_iommu_alloc_attrs,
2104 .free = arm_iommu_free_attrs, 2104 .free = arm_iommu_free_attrs,
2105 .mmap = arm_iommu_mmap_attrs, 2105 .mmap = arm_iommu_mmap_attrs,
@@ -2119,7 +2119,7 @@ struct dma_map_ops iommu_ops = {
2119 .unmap_resource = arm_iommu_unmap_resource, 2119 .unmap_resource = arm_iommu_unmap_resource,
2120}; 2120};
2121 2121
2122struct dma_map_ops iommu_coherent_ops = { 2122const struct dma_map_ops iommu_coherent_ops = {
2123 .alloc = arm_coherent_iommu_alloc_attrs, 2123 .alloc = arm_coherent_iommu_alloc_attrs,
2124 .free = arm_coherent_iommu_free_attrs, 2124 .free = arm_coherent_iommu_free_attrs,
2125 .mmap = arm_coherent_iommu_mmap_attrs, 2125 .mmap = arm_coherent_iommu_mmap_attrs,
@@ -2319,7 +2319,7 @@ void arm_iommu_detach_device(struct device *dev)
2319} 2319}
2320EXPORT_SYMBOL_GPL(arm_iommu_detach_device); 2320EXPORT_SYMBOL_GPL(arm_iommu_detach_device);
2321 2321
2322static struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent) 2322static const struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent)
2323{ 2323{
2324 return coherent ? &iommu_coherent_ops : &iommu_ops; 2324 return coherent ? &iommu_coherent_ops : &iommu_ops;
2325} 2325}
@@ -2374,7 +2374,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { }
2374 2374
2375#endif /* CONFIG_ARM_DMA_USE_IOMMU */ 2375#endif /* CONFIG_ARM_DMA_USE_IOMMU */
2376 2376
2377static struct dma_map_ops *arm_get_dma_map_ops(bool coherent) 2377static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
2378{ 2378{
2379 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops; 2379 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;
2380} 2380}
@@ -2382,7 +2382,7 @@ static struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
2382void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, 2382void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
2383 const struct iommu_ops *iommu, bool coherent) 2383 const struct iommu_ops *iommu, bool coherent)
2384{ 2384{
2385 struct dma_map_ops *dma_ops; 2385 const struct dma_map_ops *dma_ops;
2386 2386
2387 dev->archdata.dma_coherent = coherent; 2387 dev->archdata.dma_coherent = coherent;
2388 if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu)) 2388 if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu))