Skip to content

Commit 2263d81

Browse files
committed
iommu/pamu: Use dev_iommu_priv_get/set()
Remove the use of dev->archdata.iommu_domain and use the private per-device pointer provided by IOMMU core code instead. Signed-off-by: Joerg Roedel <[email protected]> Reviewed-by: Jerry Snitselaar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a5616e2 commit 2263d81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/iommu/fsl_pamu_domain.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static void remove_device_ref(struct device_domain_info *info, u32 win_cnt)
323323
pamu_disable_liodn(info->liodn);
324324
spin_unlock_irqrestore(&iommu_lock, flags);
325325
spin_lock_irqsave(&device_domain_lock, flags);
326-
info->dev->archdata.iommu_domain = NULL;
326+
dev_iommu_priv_set(info->dev, NULL);
327327
kmem_cache_free(iommu_devinfo_cache, info);
328328
spin_unlock_irqrestore(&device_domain_lock, flags);
329329
}
@@ -352,7 +352,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
352352
* Check here if the device is already attached to domain or not.
353353
* If the device is already attached to a domain detach it.
354354
*/
355-
old_domain_info = dev->archdata.iommu_domain;
355+
old_domain_info = dev_iommu_priv_get(dev);
356356
if (old_domain_info && old_domain_info->domain != dma_domain) {
357357
spin_unlock_irqrestore(&device_domain_lock, flags);
358358
detach_device(dev, old_domain_info->domain);
@@ -371,8 +371,8 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
371371
* the info for the first LIODN as all
372372
* LIODNs share the same domain
373373
*/
374-
if (!dev->archdata.iommu_domain)
375-
dev->archdata.iommu_domain = info;
374+
if (!dev_iommu_priv_get(dev))
375+
dev_iommu_priv_set(dev, info);
376376
spin_unlock_irqrestore(&device_domain_lock, flags);
377377
}
378378

0 commit comments

Comments
 (0)