]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/iommu/iommu.c
iommu: Allow taking a reference on a group directly
[linux.git] / drivers / iommu / iommu.c
index 9a2f1960873b65e01b29ff5f1d84148ce4bae094..9408c3145483c4ce9dcb335b22f9bde1810779bb 100644 (file)
@@ -551,6 +551,19 @@ struct iommu_group *iommu_group_get(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(iommu_group_get);
 
+/**
+ * iommu_group_ref_get - Increment reference on a group
+ * @group: the group to use, must not be NULL
+ *
+ * This function is called by iommu drivers to take additional references on an
+ * existing group.  Returns the given group for convenience.
+ */
+struct iommu_group *iommu_group_ref_get(struct iommu_group *group)
+{
+       kobject_get(group->devices_kobj);
+       return group;
+}
+
 /**
  * iommu_group_put - Decrement group reference
  * @group: the group to use