@@ -173,7 +173,7 @@ static u32 lv2ent_offset(sysmmu_iova_t iova)
173
173
#define REG_V5_FAULT_AR_VA 0x070
174
174
#define REG_V5_FAULT_AW_VA 0x080
175
175
176
- #define has_sysmmu (dev ) (dev->archdata.iommu != NULL)
176
+ #define has_sysmmu (dev ) (dev_iommu_priv_get( dev) != NULL)
177
177
178
178
static struct device * dma_dev ;
179
179
static struct kmem_cache * lv2table_kmem_cache ;
@@ -226,7 +226,7 @@ static const struct sysmmu_fault_info sysmmu_v5_faults[] = {
226
226
};
227
227
228
228
/*
229
- * This structure is attached to dev.archdata. iommu of the master device
229
+ * This structure is attached to dev-> iommu->priv of the master device
230
230
* on device add, contains a list of SYSMMU controllers defined by device tree,
231
231
* which are bound to given master device. It is usually referenced by 'owner'
232
232
* pointer.
@@ -670,7 +670,7 @@ static int __maybe_unused exynos_sysmmu_suspend(struct device *dev)
670
670
struct device * master = data -> master ;
671
671
672
672
if (master ) {
673
- struct exynos_iommu_owner * owner = master -> archdata . iommu ;
673
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get ( master ) ;
674
674
675
675
mutex_lock (& owner -> rpm_lock );
676
676
if (data -> domain ) {
@@ -688,7 +688,7 @@ static int __maybe_unused exynos_sysmmu_resume(struct device *dev)
688
688
struct device * master = data -> master ;
689
689
690
690
if (master ) {
691
- struct exynos_iommu_owner * owner = master -> archdata . iommu ;
691
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get ( master ) ;
692
692
693
693
mutex_lock (& owner -> rpm_lock );
694
694
if (data -> domain ) {
@@ -837,8 +837,8 @@ static void exynos_iommu_domain_free(struct iommu_domain *iommu_domain)
837
837
static void exynos_iommu_detach_device (struct iommu_domain * iommu_domain ,
838
838
struct device * dev )
839
839
{
840
- struct exynos_iommu_owner * owner = dev -> archdata .iommu ;
841
840
struct exynos_iommu_domain * domain = to_exynos_domain (iommu_domain );
841
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get (dev );
842
842
phys_addr_t pagetable = virt_to_phys (domain -> pgtable );
843
843
struct sysmmu_drvdata * data , * next ;
844
844
unsigned long flags ;
@@ -875,8 +875,8 @@ static void exynos_iommu_detach_device(struct iommu_domain *iommu_domain,
875
875
static int exynos_iommu_attach_device (struct iommu_domain * iommu_domain ,
876
876
struct device * dev )
877
877
{
878
- struct exynos_iommu_owner * owner = dev -> archdata .iommu ;
879
878
struct exynos_iommu_domain * domain = to_exynos_domain (iommu_domain );
879
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get (dev );
880
880
struct sysmmu_drvdata * data ;
881
881
phys_addr_t pagetable = virt_to_phys (domain -> pgtable );
882
882
unsigned long flags ;
@@ -1237,7 +1237,7 @@ static phys_addr_t exynos_iommu_iova_to_phys(struct iommu_domain *iommu_domain,
1237
1237
1238
1238
static struct iommu_device * exynos_iommu_probe_device (struct device * dev )
1239
1239
{
1240
- struct exynos_iommu_owner * owner = dev -> archdata . iommu ;
1240
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get ( dev ) ;
1241
1241
struct sysmmu_drvdata * data ;
1242
1242
1243
1243
if (!has_sysmmu (dev ))
@@ -1263,7 +1263,7 @@ static struct iommu_device *exynos_iommu_probe_device(struct device *dev)
1263
1263
1264
1264
static void exynos_iommu_release_device (struct device * dev )
1265
1265
{
1266
- struct exynos_iommu_owner * owner = dev -> archdata . iommu ;
1266
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get ( dev ) ;
1267
1267
struct sysmmu_drvdata * data ;
1268
1268
1269
1269
if (!has_sysmmu (dev ))
@@ -1287,8 +1287,8 @@ static void exynos_iommu_release_device(struct device *dev)
1287
1287
static int exynos_iommu_of_xlate (struct device * dev ,
1288
1288
struct of_phandle_args * spec )
1289
1289
{
1290
- struct exynos_iommu_owner * owner = dev -> archdata .iommu ;
1291
1290
struct platform_device * sysmmu = of_find_device_by_node (spec -> np );
1291
+ struct exynos_iommu_owner * owner = dev_iommu_priv_get (dev );
1292
1292
struct sysmmu_drvdata * data , * entry ;
1293
1293
1294
1294
if (!sysmmu )
@@ -1305,7 +1305,7 @@ static int exynos_iommu_of_xlate(struct device *dev,
1305
1305
1306
1306
INIT_LIST_HEAD (& owner -> controllers );
1307
1307
mutex_init (& owner -> rpm_lock );
1308
- dev -> archdata . iommu = owner ;
1308
+ dev_iommu_priv_set ( dev , owner ) ;
1309
1309
}
1310
1310
1311
1311
list_for_each_entry (entry , & owner -> controllers , owner_node )
0 commit comments