@@ -179,11 +179,6 @@ static void arm_dma_sync_single_for_device(struct device *dev,
179179 __dma_page_cpu_to_dev (page , offset , size , dir );
180180}
181181
182- static int arm_dma_mapping_error (struct device * dev , dma_addr_t dma_addr )
183- {
184- return dma_addr == ARM_MAPPING_ERROR ;
185- }
186-
187182const struct dma_map_ops arm_dma_ops = {
188183 .alloc = arm_dma_alloc ,
189184 .free = arm_dma_free ,
@@ -197,7 +192,6 @@ const struct dma_map_ops arm_dma_ops = {
197192 .sync_single_for_device = arm_dma_sync_single_for_device ,
198193 .sync_sg_for_cpu = arm_dma_sync_sg_for_cpu ,
199194 .sync_sg_for_device = arm_dma_sync_sg_for_device ,
200- .mapping_error = arm_dma_mapping_error ,
201195 .dma_supported = arm_dma_supported ,
202196};
203197EXPORT_SYMBOL (arm_dma_ops );
@@ -217,7 +211,6 @@ const struct dma_map_ops arm_coherent_dma_ops = {
217211 .get_sgtable = arm_dma_get_sgtable ,
218212 .map_page = arm_coherent_dma_map_page ,
219213 .map_sg = arm_dma_map_sg ,
220- .mapping_error = arm_dma_mapping_error ,
221214 .dma_supported = arm_dma_supported ,
222215};
223216EXPORT_SYMBOL (arm_coherent_dma_ops );
@@ -774,7 +767,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
774767 gfp &= ~(__GFP_COMP );
775768 args .gfp = gfp ;
776769
777- * handle = ARM_MAPPING_ERROR ;
770+ * handle = DMA_MAPPING_ERROR ;
778771 allowblock = gfpflags_allow_blocking (gfp );
779772 cma = allowblock ? dev_get_cma_area (dev ) : false;
780773
@@ -1217,15 +1210,15 @@ static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
12171210 if (i == mapping -> nr_bitmaps ) {
12181211 if (extend_iommu_mapping (mapping )) {
12191212 spin_unlock_irqrestore (& mapping -> lock , flags );
1220- return ARM_MAPPING_ERROR ;
1213+ return DMA_MAPPING_ERROR ;
12211214 }
12221215
12231216 start = bitmap_find_next_zero_area (mapping -> bitmaps [i ],
12241217 mapping -> bits , 0 , count , align );
12251218
12261219 if (start > mapping -> bits ) {
12271220 spin_unlock_irqrestore (& mapping -> lock , flags );
1228- return ARM_MAPPING_ERROR ;
1221+ return DMA_MAPPING_ERROR ;
12291222 }
12301223
12311224 bitmap_set (mapping -> bitmaps [i ], start , count );
@@ -1409,7 +1402,7 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size,
14091402 int i ;
14101403
14111404 dma_addr = __alloc_iova (mapping , size );
1412- if (dma_addr == ARM_MAPPING_ERROR )
1405+ if (dma_addr == DMA_MAPPING_ERROR )
14131406 return dma_addr ;
14141407
14151408 iova = dma_addr ;
@@ -1436,7 +1429,7 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size,
14361429fail :
14371430 iommu_unmap (mapping -> domain , dma_addr , iova - dma_addr );
14381431 __free_iova (mapping , dma_addr , size );
1439- return ARM_MAPPING_ERROR ;
1432+ return DMA_MAPPING_ERROR ;
14401433}
14411434
14421435static int __iommu_remove_mapping (struct device * dev , dma_addr_t iova , size_t size )
@@ -1497,7 +1490,7 @@ static void *__iommu_alloc_simple(struct device *dev, size_t size, gfp_t gfp,
14971490 return NULL ;
14981491
14991492 * handle = __iommu_create_mapping (dev , & page , size , attrs );
1500- if (* handle == ARM_MAPPING_ERROR )
1493+ if (* handle == DMA_MAPPING_ERROR )
15011494 goto err_mapping ;
15021495
15031496 return addr ;
@@ -1525,7 +1518,7 @@ static void *__arm_iommu_alloc_attrs(struct device *dev, size_t size,
15251518 struct page * * pages ;
15261519 void * addr = NULL ;
15271520
1528- * handle = ARM_MAPPING_ERROR ;
1521+ * handle = DMA_MAPPING_ERROR ;
15291522 size = PAGE_ALIGN (size );
15301523
15311524 if (coherent_flag == COHERENT || !gfpflags_allow_blocking (gfp ))
@@ -1546,7 +1539,7 @@ static void *__arm_iommu_alloc_attrs(struct device *dev, size_t size,
15461539 return NULL ;
15471540
15481541 * handle = __iommu_create_mapping (dev , pages , size , attrs );
1549- if (* handle == ARM_MAPPING_ERROR )
1542+ if (* handle == DMA_MAPPING_ERROR )
15501543 goto err_buffer ;
15511544
15521545 if (attrs & DMA_ATTR_NO_KERNEL_MAPPING )
@@ -1696,10 +1689,10 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
16961689 int prot ;
16971690
16981691 size = PAGE_ALIGN (size );
1699- * handle = ARM_MAPPING_ERROR ;
1692+ * handle = DMA_MAPPING_ERROR ;
17001693
17011694 iova_base = iova = __alloc_iova (mapping , size );
1702- if (iova == ARM_MAPPING_ERROR )
1695+ if (iova == DMA_MAPPING_ERROR )
17031696 return - ENOMEM ;
17041697
17051698 for (count = 0 , s = sg ; count < (size >> PAGE_SHIFT ); s = sg_next (s )) {
@@ -1739,7 +1732,7 @@ static int __iommu_map_sg(struct device *dev, struct scatterlist *sg, int nents,
17391732 for (i = 1 ; i < nents ; i ++ ) {
17401733 s = sg_next (s );
17411734
1742- s -> dma_address = ARM_MAPPING_ERROR ;
1735+ s -> dma_address = DMA_MAPPING_ERROR ;
17431736 s -> dma_length = 0 ;
17441737
17451738 if (s -> offset || (size & ~PAGE_MASK ) || size + s -> length > max ) {
@@ -1914,7 +1907,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p
19141907 int ret , prot , len = PAGE_ALIGN (size + offset );
19151908
19161909 dma_addr = __alloc_iova (mapping , len );
1917- if (dma_addr == ARM_MAPPING_ERROR )
1910+ if (dma_addr == DMA_MAPPING_ERROR )
19181911 return dma_addr ;
19191912
19201913 prot = __dma_info_to_prot (dir , attrs );
@@ -1926,7 +1919,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p
19261919 return dma_addr + offset ;
19271920fail :
19281921 __free_iova (mapping , dma_addr , len );
1929- return ARM_MAPPING_ERROR ;
1922+ return DMA_MAPPING_ERROR ;
19301923}
19311924
19321925/**
@@ -2020,7 +2013,7 @@ static dma_addr_t arm_iommu_map_resource(struct device *dev,
20202013 size_t len = PAGE_ALIGN (size + offset );
20212014
20222015 dma_addr = __alloc_iova (mapping , len );
2023- if (dma_addr == ARM_MAPPING_ERROR )
2016+ if (dma_addr == DMA_MAPPING_ERROR )
20242017 return dma_addr ;
20252018
20262019 prot = __dma_info_to_prot (dir , attrs ) | IOMMU_MMIO ;
@@ -2032,7 +2025,7 @@ static dma_addr_t arm_iommu_map_resource(struct device *dev,
20322025 return dma_addr + offset ;
20332026fail :
20342027 __free_iova (mapping , dma_addr , len );
2035- return ARM_MAPPING_ERROR ;
2028+ return DMA_MAPPING_ERROR ;
20362029}
20372030
20382031/**
@@ -2105,7 +2098,6 @@ const struct dma_map_ops iommu_ops = {
21052098 .map_resource = arm_iommu_map_resource ,
21062099 .unmap_resource = arm_iommu_unmap_resource ,
21072100
2108- .mapping_error = arm_dma_mapping_error ,
21092101 .dma_supported = arm_dma_supported ,
21102102};
21112103
@@ -2124,7 +2116,6 @@ const struct dma_map_ops iommu_coherent_ops = {
21242116 .map_resource = arm_iommu_map_resource ,
21252117 .unmap_resource = arm_iommu_unmap_resource ,
21262118
2127- .mapping_error = arm_dma_mapping_error ,
21282119 .dma_supported = arm_dma_supported ,
21292120};
21302121
0 commit comments