iommu/amd: Remove the unused amd_iommu_get_v2_domain function
authorChristoph Hellwig <hch@lst.de>
Fri, 2 Apr 2021 14:33:10 +0000 (16:33 +0200)
committerJoerg Roedel <jroedel@suse.de>
Wed, 7 Apr 2021 09:14:47 +0000 (11:14 +0200)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210402143312.372386-3-hch@lst.de
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/iommu.c

index 026ce7f8d993b0d1f2287b45e7a41bbc7c638b8d..ed46dc754a2ad406156a9652e341cc46c623b406 100644 (file)
@@ -65,7 +65,6 @@ extern int amd_iommu_flush_tlb(struct iommu_domain *dom, u32 pasid);
 extern int amd_iommu_domain_set_gcr3(struct iommu_domain *dom, u32 pasid,
                                     unsigned long cr3);
 extern int amd_iommu_domain_clear_gcr3(struct iommu_domain *dom, u32 pasid);
-extern struct iommu_domain *amd_iommu_get_v2_domain(struct pci_dev *pdev);
 
 #ifdef CONFIG_IRQ_REMAP
 extern int amd_iommu_create_irq_domain(struct amd_iommu *iommu);
index 9b1a01602bb33fc449366e9a8bb4057d7097904a..a519aaec50e461af0c32797e8c6d738cafc03b0e 100644 (file)
@@ -2522,40 +2522,6 @@ int amd_iommu_complete_ppr(struct pci_dev *pdev, u32 pasid,
 }
 EXPORT_SYMBOL(amd_iommu_complete_ppr);
 
-struct iommu_domain *amd_iommu_get_v2_domain(struct pci_dev *pdev)
-{
-       struct protection_domain *pdomain;
-       struct iommu_dev_data *dev_data;
-       struct device *dev = &pdev->dev;
-       struct iommu_domain *io_domain;
-
-       if (!check_device(dev))
-               return NULL;
-
-       dev_data  = dev_iommu_priv_get(&pdev->dev);
-       pdomain   = dev_data->domain;
-       io_domain = iommu_get_domain_for_dev(dev);
-
-       if (pdomain == NULL && dev_data->defer_attach) {
-               dev_data->defer_attach = false;
-               pdomain = to_pdomain(io_domain);
-               attach_device(dev, pdomain);
-       }
-
-       if (pdomain == NULL)
-               return NULL;
-
-       if (io_domain->type != IOMMU_DOMAIN_DMA)
-               return NULL;
-
-       /* Only return IOMMUv2 domains */
-       if (!(pdomain->flags & PD_IOMMUV2_MASK))
-               return NULL;
-
-       return &pdomain->domain;
-}
-EXPORT_SYMBOL(amd_iommu_get_v2_domain);
-
 int amd_iommu_device_info(struct pci_dev *pdev,
                           struct amd_iommu_device_info *info)
 {