diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2023-06-05 21:59:40 -0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-07-14 16:14:12 +0200 |
commit | 5665d15d3cb796d363a2dc0d2ed17855a3cb5942 (patch) | |
tree | 75634693eb03db936389b9fec9582b8fb5c766a2 /drivers/iommu/iommu.c | |
parent | 6eb4da8cf54537992fc9843be8b2af4f83f717e0 (diff) | |
download | lwn-5665d15d3cb796d363a2dc0d2ed17855a3cb5942.tar.gz lwn-5665d15d3cb796d363a2dc0d2ed17855a3cb5942.zip |
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.c | 5 |
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); |