Skip to content

Commit 60ffc45

Browse files
LuBaoluwilldeacon
authored andcommitted
vfio/type1: Use iommu_paging_domain_alloc()
Replace iommu_domain_alloc() with iommu_paging_domain_alloc(). Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 26a5816 commit 60ffc45

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/vfio/vfio_iommu_type1.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ static int vfio_iommu_domain_alloc(struct device *dev, void *data)
21352135
{
21362136
struct iommu_domain **domain = data;
21372137

2138-
*domain = iommu_domain_alloc(dev->bus);
2138+
*domain = iommu_paging_domain_alloc(dev);
21392139
return 1; /* Don't iterate */
21402140
}
21412141

@@ -2192,11 +2192,12 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
21922192
* us a representative device for the IOMMU API call. We don't actually
21932193
* want to iterate beyond the first device (if any).
21942194
*/
2195-
ret = -EIO;
21962195
iommu_group_for_each_dev(iommu_group, &domain->domain,
21972196
vfio_iommu_domain_alloc);
2198-
if (!domain->domain)
2197+
if (IS_ERR(domain->domain)) {
2198+
ret = PTR_ERR(domain->domain);
21992199
goto out_free_domain;
2200+
}
22002201

22012202
if (iommu->nesting) {
22022203
ret = iommu_enable_nesting(domain->domain);

0 commit comments

Comments
 (0)