From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Philippe Brucker Subject: Re: [PATCH 08/15] iommu: Introduce accessors for iommu private data Date: Mon, 16 Mar 2020 16:47:49 +0100 Message-ID: <20200316154749.GI304669@myrica> References: <20200310091229.29830-1-joro@8bytes.org> <20200310091229.29830-9-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200310091229.29830-9-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, virtualization@lists.linux-foundation.org, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Rob Clark , Sean Paul , Will Deacon , Robin Murphy , Matthias Brugger , Thierry Reding , Andy Gross , Bjorn Andersson , Joerg Roedel List-Id: virtualization@lists.linuxfoundation.org On Tue, Mar 10, 2020 at 10:12:22AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > 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. > > Tested-by: Will Deacon # arm-smmu > Signed-off-by: Joerg Roedel Reviewed-by: Jean-Philippe Brucker > --- > include/linux/iommu.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index f5edc21a644d..056900e75758 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 >