]> Git Repo - J-linux.git/commitdiff
vfio/type1: Use iommu_paging_domain_alloc()
authorLu Baolu <[email protected]>
Mon, 10 Jun 2024 08:55:37 +0000 (16:55 +0800)
committerWill Deacon <[email protected]>
Thu, 4 Jul 2024 13:09:33 +0000 (14:09 +0100)
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]>
drivers/vfio/vfio_iommu_type1.c

index 3a0218171cfaa059e8e55b9f108536b30fb934e8..0960699e75543e363f51c410e7542442617844f5 100644 (file)
@@ -2135,7 +2135,7 @@ static int vfio_iommu_domain_alloc(struct device *dev, void *data)
 {
        struct iommu_domain **domain = data;
 
-       *domain = iommu_domain_alloc(dev->bus);
+       *domain = iommu_paging_domain_alloc(dev);
        return 1; /* Don't iterate */
 }
 
@@ -2192,11 +2192,12 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
         * us a representative device for the IOMMU API call. We don't actually
         * want to iterate beyond the first device (if any).
         */
-       ret = -EIO;
        iommu_group_for_each_dev(iommu_group, &domain->domain,
                                 vfio_iommu_domain_alloc);
-       if (!domain->domain)
+       if (IS_ERR(domain->domain)) {
+               ret = PTR_ERR(domain->domain);
                goto out_free_domain;
+       }
 
        if (iommu->nesting) {
                ret = iommu_enable_nesting(domain->domain);
This page took 0.055 seconds and 4 git commands to generate.