Re: [PATCH -v2 5/9] intel-iommu: convert detect_intel_iommu to useiommu_init hook

From: Ingo Molnar
Date: Tue Nov 10 2009 - 06:12:40 EST



* FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> wrote:

> This changes detect_intel_iommu() to set intel_iommu_init() to
> iommu_init hook if detect_intel_iommu() finds the IOMMU.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> ---
> arch/x86/kernel/pci-dma.c | 2 --
> drivers/pci/dmar.c | 4 ++++
> include/linux/dmar.h | 10 ----------
> 3 files changed, 4 insertions(+), 12 deletions(-)

FYI, the !CONFIG_DMAR case needed the fix below. (Wrt. the -ENODEV: it
doesnt matter right now as we dont check the result of ->iommu_init(),
but i kept it consistent with device initialization principles.)

Ingo

diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index d814d7d..df0cfb3 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -219,5 +219,8 @@ struct dmar_atsr_unit {
};

extern int intel_iommu_init(void);
-#endif
+#else /* !CONFIG_DMAR: */
+static inline int intel_iommu_init(void) { return -ENODEV; }
+#endif /* CONFIG_DMAR */
+
#endif /* __DMAR_H__ */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/