Skip to content

Commit f9867f4

Browse files
committed
iommu: Introduce accessors for iommu private data
Add dev_iommu_priv_get/set() functions to access per-device iommu private data. This makes it easier to move the pointer to a different location. Signed-off-by: Joerg Roedel <[email protected]> Tested-by: Will Deacon <[email protected]> # arm-smmu Reviewed-by: Jean-Philippe Brucker <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0b242eb commit f9867f4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/linux/iommu.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,16 @@ static inline void dev_iommu_fwspec_set(struct device *dev,
627627
dev->iommu->fwspec = fwspec;
628628
}
629629

630+
static inline void *dev_iommu_priv_get(struct device *dev)
631+
{
632+
return dev->iommu->fwspec->iommu_priv;
633+
}
634+
635+
static inline void dev_iommu_priv_set(struct device *dev, void *priv)
636+
{
637+
dev->iommu->fwspec->iommu_priv = priv;
638+
}
639+
630640
int iommu_probe_device(struct device *dev);
631641
void iommu_release_device(struct device *dev);
632642

0 commit comments

Comments
 (0)