diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2023-08-22 13:16:00 -0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-09-25 11:49:26 +0200 |
commit | ef0f48c6be822ead31465d17a429174d56300cf8 (patch) | |
tree | a15a7c1b79c2774215b5793dc81eea34c5aa92f3 /drivers | |
parent | a62cafe124b3b91ce85d17c036552b59c1243011 (diff) | |
download | linux-stable-ef0f48c6be822ead31465d17a429174d56300cf8.tar.gz linux-stable-ef0f48c6be822ead31465d17a429174d56300cf8.tar.bz2 linux-stable-ef0f48c6be822ead31465d17a429174d56300cf8.zip |
iommu/rockchip: Convert to generic_single_device_group()
Use the new helper.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/5-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/rockchip-iommu.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 5deb64b9cbe4..ce8487230209 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -113,7 +113,6 @@ struct rk_iommu { struct iommu_device iommu; struct list_head node; /* entry in rk_iommu_domain.iommus */ struct iommu_domain *domain; /* domain to which iommu is attached */ - struct iommu_group *group; }; struct rk_iommudata { @@ -1137,15 +1136,6 @@ static void rk_iommu_release_device(struct device *dev) device_link_del(data->link); } -static struct iommu_group *rk_iommu_device_group(struct device *dev) -{ - struct rk_iommu *iommu; - - iommu = rk_iommu_from_dev(dev); - - return iommu_group_ref_get(iommu->group); -} - static int rk_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) { @@ -1172,7 +1162,7 @@ static const struct iommu_ops rk_iommu_ops = { .domain_alloc_paging = rk_iommu_domain_alloc_paging, .probe_device = rk_iommu_probe_device, .release_device = rk_iommu_release_device, - .device_group = rk_iommu_device_group, + .device_group = generic_single_device_group, .pgsize_bitmap = RK_IOMMU_PGSIZE_BITMAP, .of_xlate = rk_iommu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { @@ -1260,15 +1250,9 @@ static int rk_iommu_probe(struct platform_device *pdev) if (err) return err; - iommu->group = iommu_group_alloc(); - if (IS_ERR(iommu->group)) { - err = PTR_ERR(iommu->group); - goto err_unprepare_clocks; - } - err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, dev_name(dev)); if (err) - goto err_put_group; + goto err_unprepare_clocks; err = iommu_device_register(&iommu->iommu, &rk_iommu_ops, dev); if (err) @@ -1305,8 +1289,6 @@ err_pm_disable: pm_runtime_disable(dev); err_remove_sysfs: iommu_device_sysfs_remove(&iommu->iommu); -err_put_group: - iommu_group_put(iommu->group); err_unprepare_clocks: clk_bulk_unprepare(iommu->num_clocks, iommu->clocks); return err; |