@@ -939,8 +939,7 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev,
939
939
* but an IOMMU which supports smaller pages might not map the whole thing.
940
940
*/
941
941
static struct page * * __iommu_dma_alloc_noncontiguous (struct device * dev ,
942
- size_t size , struct sg_table * sgt , gfp_t gfp , pgprot_t prot ,
943
- unsigned long attrs )
942
+ size_t size , struct sg_table * sgt , gfp_t gfp , unsigned long attrs )
944
943
{
945
944
struct iommu_domain * domain = iommu_get_dma_domain (dev );
946
945
struct iommu_dma_cookie * cookie = domain -> iova_cookie ;
@@ -1014,15 +1013,14 @@ static struct page **__iommu_dma_alloc_noncontiguous(struct device *dev,
1014
1013
}
1015
1014
1016
1015
static void * iommu_dma_alloc_remap (struct device * dev , size_t size ,
1017
- dma_addr_t * dma_handle , gfp_t gfp , pgprot_t prot ,
1018
- unsigned long attrs )
1016
+ dma_addr_t * dma_handle , gfp_t gfp , unsigned long attrs )
1019
1017
{
1020
1018
struct page * * pages ;
1021
1019
struct sg_table sgt ;
1022
1020
void * vaddr ;
1021
+ pgprot_t prot = dma_pgprot (dev , PAGE_KERNEL , attrs );
1023
1022
1024
- pages = __iommu_dma_alloc_noncontiguous (dev , size , & sgt , gfp , prot ,
1025
- attrs );
1023
+ pages = __iommu_dma_alloc_noncontiguous (dev , size , & sgt , gfp , attrs );
1026
1024
if (!pages )
1027
1025
return NULL ;
1028
1026
* dma_handle = sgt .sgl -> dma_address ;
@@ -1049,8 +1047,7 @@ static struct sg_table *iommu_dma_alloc_noncontiguous(struct device *dev,
1049
1047
if (!sh )
1050
1048
return NULL ;
1051
1049
1052
- sh -> pages = __iommu_dma_alloc_noncontiguous (dev , size , & sh -> sgt , gfp ,
1053
- PAGE_KERNEL , attrs );
1050
+ sh -> pages = __iommu_dma_alloc_noncontiguous (dev , size , & sh -> sgt , gfp , attrs );
1054
1051
if (!sh -> pages ) {
1055
1052
kfree (sh );
1056
1053
return NULL ;
@@ -1619,8 +1616,7 @@ static void *iommu_dma_alloc(struct device *dev, size_t size,
1619
1616
1620
1617
if (gfpflags_allow_blocking (gfp ) &&
1621
1618
!(attrs & DMA_ATTR_FORCE_CONTIGUOUS )) {
1622
- return iommu_dma_alloc_remap (dev , size , handle , gfp ,
1623
- dma_pgprot (dev , PAGE_KERNEL , attrs ), attrs );
1619
+ return iommu_dma_alloc_remap (dev , size , handle , gfp , attrs );
1624
1620
}
1625
1621
1626
1622
if (IS_ENABLED (CONFIG_DMA_DIRECT_REMAP ) &&
0 commit comments