Skip to content

Commit a4672d0

Browse files
jgunthorpejoergroedel
authored andcommitted
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>
1 parent 07107e7 commit a4672d0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/iommu/iommu-sva.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,12 @@ static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev,
296296
const struct iommu_ops *ops = dev_iommu_ops(dev);
297297
struct iommu_domain *domain;
298298

299-
if (ops->domain_alloc_sva) {
300-
domain = ops->domain_alloc_sva(dev, mm);
301-
if (IS_ERR(domain))
302-
return domain;
303-
} else {
304-
domain = ops->domain_alloc(IOMMU_DOMAIN_SVA);
305-
if (!domain)
306-
return ERR_PTR(-ENOMEM);
307-
}
299+
if (!ops->domain_alloc_sva)
300+
return ERR_PTR(-EOPNOTSUPP);
301+
302+
domain = ops->domain_alloc_sva(dev, mm);
303+
if (IS_ERR(domain))
304+
return domain;
308305

309306
domain->type = IOMMU_DOMAIN_SVA;
310307
domain->cookie_type = IOMMU_COOKIE_SVA;

0 commit comments

Comments
 (0)