diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2025-04-08 13:35:50 -0300 |
|---|---|---|
| committer | Joerg Roedel <jroedel@suse.de> | 2025-04-28 13:14:59 +0200 |
| commit | a4672d0fe17dd2b5b2f485ae6c98990164e874eb (patch) | |
| tree | 42873d12a873b65c819a6e7fa8ab7eee95fab9f6 | |
| parent | 07107e74444bedb943ee91ec6072c3baf62f4ae7 (diff) | |
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>
| -rw-r--r-- | drivers/iommu/iommu-sva.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index 944daa0dabd6..1a51cfd82808 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -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; |
