@@ -2659,7 +2659,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
2659
2659
if (!fwspec )
2660
2660
return - ENOENT ;
2661
2661
2662
- master = fwspec -> iommu_priv ;
2662
+ master = dev_iommu_priv_get ( dev ) ;
2663
2663
smmu = master -> smmu ;
2664
2664
2665
2665
arm_smmu_detach_dev (master );
@@ -2795,7 +2795,7 @@ static int arm_smmu_add_device(struct device *dev)
2795
2795
if (!fwspec || fwspec -> ops != & arm_smmu_ops )
2796
2796
return - ENODEV ;
2797
2797
2798
- if (WARN_ON_ONCE (fwspec -> iommu_priv ))
2798
+ if (WARN_ON_ONCE (dev_iommu_priv_get ( dev ) ))
2799
2799
return - EBUSY ;
2800
2800
2801
2801
smmu = arm_smmu_get_by_fwnode (fwspec -> iommu_fwnode );
@@ -2810,7 +2810,7 @@ static int arm_smmu_add_device(struct device *dev)
2810
2810
master -> smmu = smmu ;
2811
2811
master -> sids = fwspec -> ids ;
2812
2812
master -> num_sids = fwspec -> num_ids ;
2813
- fwspec -> iommu_priv = master ;
2813
+ dev_iommu_priv_set ( dev , master ) ;
2814
2814
2815
2815
/* Check the SIDs are in range of the SMMU and our stream table */
2816
2816
for (i = 0 ; i < master -> num_sids ; i ++ ) {
@@ -2852,7 +2852,7 @@ static int arm_smmu_add_device(struct device *dev)
2852
2852
iommu_device_unlink (& smmu -> iommu , dev );
2853
2853
err_free_master :
2854
2854
kfree (master );
2855
- fwspec -> iommu_priv = NULL ;
2855
+ dev_iommu_priv_set ( dev , NULL ) ;
2856
2856
return ret ;
2857
2857
}
2858
2858
@@ -2865,7 +2865,7 @@ static void arm_smmu_remove_device(struct device *dev)
2865
2865
if (!fwspec || fwspec -> ops != & arm_smmu_ops )
2866
2866
return ;
2867
2867
2868
- master = fwspec -> iommu_priv ;
2868
+ master = dev_iommu_priv_get ( dev ) ;
2869
2869
smmu = master -> smmu ;
2870
2870
arm_smmu_detach_dev (master );
2871
2871
iommu_group_remove_device (dev );
0 commit comments