Skip to content

Commit

Permalink
iommu: Introduce accessors for iommu private data
Browse files Browse the repository at this point in the history
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 <jroedel@suse.de>
Tested-by: Will Deacon <will@kernel.org> # arm-smmu
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Link: https://lore.kernel.org/r/20200326150841.10083-9-joro@8bytes.org
  • Loading branch information
Joerg Roedel committed Mar 27, 2020
1 parent 0b242eb commit f9867f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/linux/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,16 @@ static inline void dev_iommu_fwspec_set(struct device *dev,
dev->iommu->fwspec = fwspec;
}

static inline void *dev_iommu_priv_get(struct device *dev)
{
return dev->iommu->fwspec->iommu_priv;
}

static inline void dev_iommu_priv_set(struct device *dev, void *priv)
{
dev->iommu->fwspec->iommu_priv = priv;
}

int iommu_probe_device(struct device *dev);
void iommu_release_device(struct device *dev);

Expand Down

0 comments on commit f9867f4

Please sign in to comment.