Commit 986d5ecc authored by Joerg Roedel's avatar Joerg Roedel

iommu: Move fwspec->iommu_priv to struct dev_iommu

Move the pointer for iommu private data from struct iommu_fwspec to
struct dev_iommu.
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Tested-by: Will Deacon <will@kernel.org> # arm-smmu
Reviewed-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
Link: https://lore.kernel.org/r/20200326150841.10083-17-joro@8bytes.org
parent a4b6c2af
...@@ -369,6 +369,7 @@ struct iommu_fault_param { ...@@ -369,6 +369,7 @@ struct iommu_fault_param {
* *
* @fault_param: IOMMU detected device fault reporting data * @fault_param: IOMMU detected device fault reporting data
* @fwspec: IOMMU fwspec data * @fwspec: IOMMU fwspec data
* @priv: IOMMU Driver private data
* *
* TODO: migrate other per device data pointers under iommu_dev_data, e.g. * TODO: migrate other per device data pointers under iommu_dev_data, e.g.
* struct iommu_group *iommu_group; * struct iommu_group *iommu_group;
...@@ -377,6 +378,7 @@ struct dev_iommu { ...@@ -377,6 +378,7 @@ struct dev_iommu {
struct mutex lock; struct mutex lock;
struct iommu_fault_param *fault_param; struct iommu_fault_param *fault_param;
struct iommu_fwspec *fwspec; struct iommu_fwspec *fwspec;
void *priv;
}; };
int iommu_device_register(struct iommu_device *iommu); int iommu_device_register(struct iommu_device *iommu);
...@@ -589,7 +591,6 @@ struct iommu_group *fsl_mc_device_group(struct device *dev); ...@@ -589,7 +591,6 @@ struct iommu_group *fsl_mc_device_group(struct device *dev);
struct iommu_fwspec { struct iommu_fwspec {
const struct iommu_ops *ops; const struct iommu_ops *ops;
struct fwnode_handle *iommu_fwnode; struct fwnode_handle *iommu_fwnode;
void *iommu_priv;
u32 flags; u32 flags;
u32 num_pasid_bits; u32 num_pasid_bits;
unsigned int num_ids; unsigned int num_ids;
...@@ -629,12 +630,12 @@ static inline void dev_iommu_fwspec_set(struct device *dev, ...@@ -629,12 +630,12 @@ static inline void dev_iommu_fwspec_set(struct device *dev,
static inline void *dev_iommu_priv_get(struct device *dev) static inline void *dev_iommu_priv_get(struct device *dev)
{ {
return dev->iommu->fwspec->iommu_priv; return dev->iommu->priv;
} }
static inline void dev_iommu_priv_set(struct device *dev, void *priv) static inline void dev_iommu_priv_set(struct device *dev, void *priv)
{ {
dev->iommu->fwspec->iommu_priv = priv; dev->iommu->priv = priv;
} }
int iommu_probe_device(struct device *dev); int iommu_probe_device(struct device *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment