aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 2cb54adc4a33..176f7569d874 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -240,7 +240,7 @@ struct iommu_device {
240 struct list_head list; 240 struct list_head list;
241 const struct iommu_ops *ops; 241 const struct iommu_ops *ops;
242 struct fwnode_handle *fwnode; 242 struct fwnode_handle *fwnode;
243 struct device dev; 243 struct device *dev;
244}; 244};
245 245
246int iommu_device_register(struct iommu_device *iommu); 246int iommu_device_register(struct iommu_device *iommu);
@@ -265,6 +265,11 @@ static inline void iommu_device_set_fwnode(struct iommu_device *iommu,
265 iommu->fwnode = fwnode; 265 iommu->fwnode = fwnode;
266} 266}
267 267
268static inline struct iommu_device *dev_to_iommu_device(struct device *dev)
269{
270 return (struct iommu_device *)dev_get_drvdata(dev);
271}
272
268#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */ 273#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */
269#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */ 274#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */
270#define IOMMU_GROUP_NOTIFY_BIND_DRIVER 3 /* Pre Driver bind */ 275#define IOMMU_GROUP_NOTIFY_BIND_DRIVER 3 /* Pre Driver bind */
@@ -589,6 +594,11 @@ static inline void iommu_device_set_fwnode(struct iommu_device *iommu,
589{ 594{
590} 595}
591 596
597static inline struct iommu_device *dev_to_iommu_device(struct device *dev)
598{
599 return NULL;
600}
601
592static inline void iommu_device_unregister(struct iommu_device *iommu) 602static inline void iommu_device_unregister(struct iommu_device *iommu)
593{ 603{
594} 604}