RE: [PATCH 02/11] iommu: Use iommu_group_ref_get/put() for dev->iommu_group

2023-04-26 Thread Tian, Kevin
> From: Jason Gunthorpe 
> Sent: Thursday, April 20, 2023 12:12 AM
> 
> No reason to open code this, use the proper helper functions.
> 
> Signed-off-by: Jason Gunthorpe 

Reviewed-by: Kevin Tian 


[PATCH 02/11] iommu: Use iommu_group_ref_get/put() for dev->iommu_group

2023-04-19 Thread Jason Gunthorpe
No reason to open code this, use the proper helper functions.

Signed-off-by: Jason Gunthorpe 
---
 drivers/iommu/iommu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index c486e648402d5c..73e9f50fba9dd2 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -496,7 +496,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)
@@ -1063,8 +1063,7 @@ int iommu_group_add_device(struct iommu_group *group, 
struct device *dev)
goto err_free_name;
}
 
-   kobject_get(group->devices_kobj);
-
+   iommu_group_ref_get(group);
dev->iommu_group = group;
 
mutex_lock(>mutex);
-- 
2.40.0