History

iommu: Move fwspec->iommu_priv to struct dev_iommu

Move the pointer for iommu private data from struct iommu_fwspec to struct dev_iommu.

Joerg Roedel committed 6 years ago

Commit 986d5ec1 parent a4b6c2a1 file · +4 −3Browse files

Unified · Split

include/linux/iommu.h+4−3
@@ -369,6 +369,7 @@ struct iommu_fault_param { · 368 unmodified lines
369369 *
370370 * @fault_param: IOMMU detected device fault reporting data
371371 * @fwspec: IOMMU fwspec data
372+ * @priv: IOMMU Driver private data
372373 *
373374 * TODO: migrate other per device data pointers under iommu_dev_data, e.g.
374375 * struct iommu_group *iommu_group;
@@ -377,6 +378,7 @@ struct dev_iommu { · 2 unmodified lines
377378 struct mutex lock;
378379 struct iommu_fault_param *fault_param;
379380 struct iommu_fwspec *fwspec;
381+ void *priv;
380382 };
381383
382384 int iommu_device_register(struct iommu_device *iommu);
@@ -589,7 +591,6 @@ struct iommu_group *fsl_mc_device_group(struct device *dev); · 206 unmodified lines
589591 struct iommu_fwspec {
590592 const struct iommu_ops *ops;
591593 struct fwnode_handle *iommu_fwnode;
592− void *iommu_priv;
593594 u32 flags;
594595 u32 num_pasid_bits;
595596 unsigned int num_ids;
@@ -629,12 +630,12 @@ static inline void dev_iommu_fwspec_set(struct device *dev, · 33 unmodified lines
629630
630631 static inline void *dev_iommu_priv_get(struct device *dev)
631632 {
632− return dev->iommu->fwspec->iommu_priv;
633+ return dev->iommu->priv;
633634 }
634635
635636 static inline void dev_iommu_priv_set(struct device *dev, void *priv)
636637 {
637− dev->iommu->fwspec->iommu_priv = priv;
638+ dev->iommu->priv = priv;
638639 }
639640
640641 int iommu_probe_device(struct device *dev);