Skip to content

Commit 5665d15

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu: Use iommu_group_ref_get/put() for dev->iommu_group
No reason to open code this, use the proper helper functions. Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 6eb4da8 commit 5665d15

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/iommu/iommu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static void __iommu_group_release_device(struct iommu_group *group,
500500
kfree(grp_dev->name);
501501
kfree(grp_dev);
502502
dev->iommu_group = NULL;
503-
kobject_put(group->devices_kobj);
503+
iommu_group_put(group);
504504
}
505505

506506
static void iommu_release_device(struct device *dev)
@@ -1067,8 +1067,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
10671067
goto err_free_name;
10681068
}
10691069

1070-
kobject_get(group->devices_kobj);
1071-
1070+
iommu_group_ref_get(group);
10721071
dev->iommu_group = group;
10731072

10741073
mutex_lock(&group->mutex);

0 commit comments

Comments
 (0)