summaryrefslogtreecommitdiff
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2020-03-26 18:08:33 +0300
committerJoerg Roedel <jroedel@suse.de>2020-03-27 13:14:51 +0300
commitf9867f416ee721141e1664810516b8ebc2563cdd (patch)
tree3072901b7dea25e68c5b7912f9f5940ed69785bf /include/linux/iommu.h
parent0b242ebbb7fca818323d02d2bbb08ff7d425f594 (diff)
downloadlinux-f9867f416ee721141e1664810516b8ebc2563cdd.tar.xz
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 <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
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index d031ddc0596b..49e3173260b3 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -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);