@@ -180,7 +180,7 @@ static void arm_dma_sync_single_for_device(struct device *dev,
180180 __dma_page_cpu_to_dev (page , offset , size , dir );
181181}
182182
183- struct dma_map_ops arm_dma_ops = {
183+ const struct dma_map_ops arm_dma_ops = {
184184 .alloc = arm_dma_alloc ,
185185 .free = arm_dma_free ,
186186 .mmap = arm_dma_mmap ,
@@ -204,7 +204,7 @@ static int arm_coherent_dma_mmap(struct device *dev, struct vm_area_struct *vma,
204204 void * cpu_addr , dma_addr_t dma_addr , size_t size ,
205205 unsigned long attrs );
206206
207- struct dma_map_ops arm_coherent_dma_ops = {
207+ const struct dma_map_ops arm_coherent_dma_ops = {
208208 .alloc = arm_coherent_dma_alloc ,
209209 .free = arm_coherent_dma_free ,
210210 .mmap = arm_coherent_dma_mmap ,
@@ -1067,7 +1067,7 @@ static void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
10671067int arm_dma_map_sg (struct device * dev , struct scatterlist * sg , int nents ,
10681068 enum dma_data_direction dir , unsigned long attrs )
10691069{
1070- struct dma_map_ops * ops = get_dma_ops (dev );
1070+ const struct dma_map_ops * ops = get_dma_ops (dev );
10711071 struct scatterlist * s ;
10721072 int i , j ;
10731073
@@ -1101,7 +1101,7 @@ int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
11011101void arm_dma_unmap_sg (struct device * dev , struct scatterlist * sg , int nents ,
11021102 enum dma_data_direction dir , unsigned long attrs )
11031103{
1104- struct dma_map_ops * ops = get_dma_ops (dev );
1104+ const struct dma_map_ops * ops = get_dma_ops (dev );
11051105 struct scatterlist * s ;
11061106
11071107 int i ;
@@ -1120,7 +1120,7 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
11201120void arm_dma_sync_sg_for_cpu (struct device * dev , struct scatterlist * sg ,
11211121 int nents , enum dma_data_direction dir )
11221122{
1123- struct dma_map_ops * ops = get_dma_ops (dev );
1123+ const struct dma_map_ops * ops = get_dma_ops (dev );
11241124 struct scatterlist * s ;
11251125 int i ;
11261126
@@ -1139,7 +1139,7 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
11391139void arm_dma_sync_sg_for_device (struct device * dev , struct scatterlist * sg ,
11401140 int nents , enum dma_data_direction dir )
11411141{
1142- struct dma_map_ops * ops = get_dma_ops (dev );
1142+ const struct dma_map_ops * ops = get_dma_ops (dev );
11431143 struct scatterlist * s ;
11441144 int i ;
11451145
@@ -2099,7 +2099,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
20992099 __dma_page_cpu_to_dev (page , offset , size , dir );
21002100}
21012101
2102- struct dma_map_ops iommu_ops = {
2102+ const struct dma_map_ops iommu_ops = {
21032103 .alloc = arm_iommu_alloc_attrs ,
21042104 .free = arm_iommu_free_attrs ,
21052105 .mmap = arm_iommu_mmap_attrs ,
@@ -2119,7 +2119,7 @@ struct dma_map_ops iommu_ops = {
21192119 .unmap_resource = arm_iommu_unmap_resource ,
21202120};
21212121
2122- struct dma_map_ops iommu_coherent_ops = {
2122+ const struct dma_map_ops iommu_coherent_ops = {
21232123 .alloc = arm_coherent_iommu_alloc_attrs ,
21242124 .free = arm_coherent_iommu_free_attrs ,
21252125 .mmap = arm_coherent_iommu_mmap_attrs ,
@@ -2319,7 +2319,7 @@ void arm_iommu_detach_device(struct device *dev)
23192319}
23202320EXPORT_SYMBOL_GPL (arm_iommu_detach_device );
23212321
2322- static struct dma_map_ops * arm_get_iommu_dma_map_ops (bool coherent )
2322+ static const struct dma_map_ops * arm_get_iommu_dma_map_ops (bool coherent )
23232323{
23242324 return coherent ? & iommu_coherent_ops : & iommu_ops ;
23252325}
@@ -2374,15 +2374,15 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { }
23742374
23752375#endif /* CONFIG_ARM_DMA_USE_IOMMU */
23762376
2377- static struct dma_map_ops * arm_get_dma_map_ops (bool coherent )
2377+ static const struct dma_map_ops * arm_get_dma_map_ops (bool coherent )
23782378{
23792379 return coherent ? & arm_coherent_dma_ops : & arm_dma_ops ;
23802380}
23812381
23822382void arch_setup_dma_ops (struct device * dev , u64 dma_base , u64 size ,
23832383 const struct iommu_ops * iommu , bool coherent )
23842384{
2385- struct dma_map_ops * dma_ops ;
2385+ const struct dma_map_ops * dma_ops ;
23862386
23872387 dev -> archdata .dma_coherent = coherent ;
23882388 if (arm_setup_iommu_dma_ops (dev , dma_base , size , iommu ))
0 commit comments