iommu: Do not call domain_alloc() in iommu_sva_domain_alloc()

No driver implements SVA under domain_alloc() anymore, this is dead
code.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/4-v4-ff5fb6b03bd1+288-iommu_virtio_domains_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
Jason Gunthorpe 2025-04-08 13:35:50 -03:00 committed by Joerg Roedel
parent 07107e7444
commit a4672d0fe1

View File

@ -296,15 +296,12 @@ static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
const struct iommu_ops *ops = dev_iommu_ops(dev);
struct iommu_domain *domain;
if (ops->domain_alloc_sva) {
domain = ops->domain_alloc_sva(dev, mm);
if (IS_ERR(domain))
return domain;
} else {
domain = ops->domain_alloc(IOMMU_DOMAIN_SVA);
if (!domain)
return ERR_PTR(-ENOMEM);
}
if (!ops->domain_alloc_sva)
return ERR_PTR(-EOPNOTSUPP);
domain = ops->domain_alloc_sva(dev, mm);
if (IS_ERR(domain))
return domain;
domain->type = IOMMU_DOMAIN_SVA;
domain->cookie_type = IOMMU_COOKIE_SVA;