[PATCH 3/8] iommu/amd: Making amd_iommu_pdev_enable_cap_ats non-static

Suravee Suthikulpanit posted 8 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH 3/8] iommu/amd: Making amd_iommu_pdev_enable_cap_ats non-static
Posted by Suravee Suthikulpanit 1 month, 2 weeks ago
To allow reuse in subsequent patches.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 drivers/iommu/amd/amd_iommu.h | 1 +
 drivers/iommu/amd/iommu.c     | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h
index 5085aa353522..3ff380afb9f4 100644
--- a/drivers/iommu/amd/amd_iommu.h
+++ b/drivers/iommu/amd/amd_iommu.h
@@ -27,6 +27,7 @@ void iommu_feature_enable(struct amd_iommu *iommu, u8 bit);
 void *__init iommu_alloc_4k_pages(struct amd_iommu *iommu,
 				  gfp_t gfp, size_t size);
 int amd_iommu_pdom_id_alloc(void);
+int amd_iommu_pdev_enable_cap_ats(struct pci_dev *pdev);
 
 #ifdef CONFIG_AMD_IOMMU_DEBUGFS
 void amd_iommu_debugfs_setup(void);
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 207fef84a4c5..44f9a8990d87 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -531,7 +531,7 @@ static u32 pdev_get_caps(struct pci_dev *pdev)
 	return flags;
 }
 
-static inline int pdev_enable_cap_ats(struct pci_dev *pdev)
+int amd_iommu_pdev_enable_cap_ats(struct pci_dev *pdev)
 {
 	struct iommu_dev_data *dev_data = dev_iommu_priv_get(&pdev->dev);
 	int ret = -EINVAL;
@@ -629,7 +629,7 @@ static inline void pdev_disable_cap_pasid(struct pci_dev *pdev)
 static void pdev_enable_caps(struct pci_dev *pdev)
 {
 	pdev_enable_cap_pasid(pdev);
-	pdev_enable_cap_ats(pdev);
+	amd_iommu_pdev_enable_cap_ats(pdev);
 	pdev_enable_cap_pri(pdev);
 }
 
@@ -2303,7 +2303,7 @@ int __amd_iommu_attach_device(struct device *dev, struct protection_domain *doma
 		if (amd_iommu_iopf_add_device(iommu, dev_data))
 			pdev_disable_cap_pri(pdev);
 	} else if (pdev) {
-		pdev_enable_cap_ats(pdev);
+		amd_iommu_pdev_enable_cap_ats(pdev);
 	}
 
 	/* Update data structures */
-- 
2.34.1