summaryrefslogtreecommitdiff
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2023-06-06 03:59:40 +0300
committerJoerg Roedel <jroedel@suse.de>2023-07-14 17:14:12 +0300
commit5665d15d3cb796d363a2dc0d2ed17855a3cb5942 (patch)
tree75634693eb03db936389b9fec9582b8fb5c766a2 /drivers/iommu/iommu.c
parent6eb4da8cf54537992fc9843be8b2af4f83f717e0 (diff)
downloadlinux-5665d15d3cb796d363a2dc0d2ed17855a3cb5942.tar.xz
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 <kevin.tian@intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/2-v3-328044aa278c+45e49-iommu_probe_jgg@nvidia.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index bdc5ce884b7b..2f16f988ab36 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -500,7 +500,7 @@ static void __iommu_group_release_device(struct iommu_group *group,
kfree(grp_dev->name);
kfree(grp_dev);
dev->iommu_group = NULL;
- kobject_put(group->devices_kobj);
+ iommu_group_put(group);
}
static void iommu_release_device(struct device *dev)
@@ -1067,8 +1067,7 @@ rename:
goto err_free_name;
}
- kobject_get(group->devices_kobj);
-
+ iommu_group_ref_get(group);
dev->iommu_group = group;
mutex_lock(&group->mutex);