[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231017032045.114868-6-tina.zhang@intel.com>
Date: Tue, 17 Oct 2023 11:20:37 +0800
From: Tina Zhang <tina.zhang@...el.com>
To: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>, Jason Gunthorpe <jgg@...pe.ca>,
Kevin Tian <kevin.tian@...el.com>,
Tina Zhang <tina.zhang@...el.com>
Subject: [RFC PATCH 04/12] iommu/vt-d: Make dev_to_intel_iommu() helper global
Make dev_to_intel_iommu() global so that it can be used by other files.
Signed-off-by: Tina Zhang <tina.zhang@...el.com>
---
drivers/iommu/intel/iommu.c | 7 -------
drivers/iommu/intel/iommu.h | 6 ++++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 3685ba90ec88..eeb658d3bc6e 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3609,13 +3609,6 @@ void intel_iommu_shutdown(void)
up_write(&dmar_global_lock);
}
-static inline struct intel_iommu *dev_to_intel_iommu(struct device *dev)
-{
- struct iommu_device *iommu_dev = dev_to_iommu_device(dev);
-
- return container_of(iommu_dev, struct intel_iommu, iommu);
-}
-
static ssize_t version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 7dac94f62b4e..1e972e7edeca 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -842,6 +842,12 @@ void *alloc_pgtable_page(int node, gfp_t gfp);
void free_pgtable_page(void *vaddr);
void iommu_flush_write_buffer(struct intel_iommu *iommu);
struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn);
+static inline struct intel_iommu *dev_to_intel_iommu(struct device *dev)
+{
+ struct iommu_device *iommu_dev = dev_to_iommu_device(dev);
+
+ return container_of(iommu_dev, struct intel_iommu, iommu);
+}
#ifdef CONFIG_INTEL_IOMMU_SVM
void intel_svm_check(struct intel_iommu *iommu);
--
2.39.3
Powered by blists - more mailing lists