Skip to content

Commit d8c07be

Browse files
LuBaoluLyude
authored andcommitted
drm/rockchip: Use iommu_paging_domain_alloc()
Commit <421be3ee36a4> ("drm/rockchip: Refactor IOMMU initialisation") has refactored rockchip_drm_init_iommu() to pass a device that the domain is allocated for. Replace iommu_domain_alloc() with iommu_paging_domain_alloc() to retire the former. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: Andy Yan <andyshrk@163.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240902014700.66095-3-baolu.lu@linux.intel.com
1 parent 8c7c44b commit d8c07be

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_drv.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,17 @@ static int rockchip_drm_init_iommu(struct drm_device *drm_dev)
103103
struct rockchip_drm_private *private = drm_dev->dev_private;
104104
struct iommu_domain_geometry *geometry;
105105
u64 start, end;
106+
int ret;
106107

107108
if (IS_ERR_OR_NULL(private->iommu_dev))
108109
return 0;
109110

110-
private->domain = iommu_domain_alloc(private->iommu_dev->bus);
111-
if (!private->domain)
112-
return -ENOMEM;
111+
private->domain = iommu_paging_domain_alloc(private->iommu_dev);
112+
if (IS_ERR(private->domain)) {
113+
ret = PTR_ERR(private->domain);
114+
private->domain = NULL;
115+
return ret;
116+
}
113117

114118
geometry = &private->domain->geometry;
115119
start = geometry->aperture_start;

0 commit comments

Comments
 (0)