[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200228150820.15340-8-joro@8bytes.org>
Date: Fri, 28 Feb 2020 16:08:13 +0100
From: Joerg Roedel <joro@...tes.org>
To: iommu@...ts.linux-foundation.org
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
virtualization@...ts.linux-foundation.org,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Hanjun Guo <guohanjun@...wei.com>,
Sudeep Holla <sudeep.holla@....com>,
Rob Clark <robdclark@...il.com>, Sean Paul <sean@...rly.run>,
Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Joerg Roedel <joro@...tes.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Joerg Roedel <jroedel@...e.de>
Subject: [PATCH 07/14] iommu: Introduce accessors for iommu private data
From: Joerg Roedel <jroedel@...e.de>
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@...e.de>
---
include/linux/iommu.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a049bcb660e1..904fb24418e5 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);
--
2.17.1
Powered by blists - more mailing lists