]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
iommu: Add iommu_device_set_fwnode() interface
authorJoerg Roedel <jroedel@suse.de>
Tue, 7 Feb 2017 17:18:46 +0000 (18:18 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:50:05 +0000 (10:50 +0200)
Allow to store a fwnode in 'struct iommu_device';

BugLink: http://bugs.launchpad.net/bugs/1688158
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit c73e1ac8b2bc6ab18d9f9a96b17ee7388b49a0c0)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/linux/iommu.h

index ac7c0f88c245537e65e752d45052e16348651899..73d0e48a796e3ab2baaa494a28f93d914ecd373e 100644 (file)
@@ -222,6 +222,7 @@ struct iommu_ops {
 struct iommu_device {
        struct list_head list;
        const struct iommu_ops *ops;
+       struct fwnode_handle *fwnode;
        struct device dev;
 };
 
@@ -241,6 +242,12 @@ static inline void iommu_device_set_ops(struct iommu_device *iommu,
        iommu->ops = ops;
 }
 
+static inline void iommu_device_set_fwnode(struct iommu_device *iommu,
+                                          struct fwnode_handle *fwnode)
+{
+       iommu->fwnode = fwnode;
+}
+
 #define IOMMU_GROUP_NOTIFY_ADD_DEVICE          1 /* Device added */
 #define IOMMU_GROUP_NOTIFY_DEL_DEVICE          2 /* Pre Device removed */
 #define IOMMU_GROUP_NOTIFY_BIND_DRIVER         3 /* Pre Driver bind */
@@ -598,6 +605,11 @@ static inline void iommu_device_set_ops(struct iommu_device *iommu,
 {
 }
 
+static inline void iommu_device_set_fwnode(struct iommu_device *iommu,
+                                          struct fwnode_handle *fwnode)
+{
+}
+
 static inline void iommu_device_unregister(struct iommu_device *iommu)
 {
 }