summaryrefslogtreecommitdiffstats
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-09-06 16:48:40 +0200
committerJoerg Roedel <joerg.roedel@amd.com>2011-10-21 14:37:18 +0200
commit39d4ebb95925046863dc0ef2698dfcf2c1f1dcbe (patch)
treead9a31efe5d83217d49603dbe3894d80717c754b /include/linux/iommu.h
parent51acc0bcfc91987ed38195918e0b40ff05197585 (diff)
iommu/core: Define iommu_ops and register_iommu only with CONFIG_IOMMU_API
This makes it impossible to compile an iommu driver into the kernel without selecting CONFIG_IOMMU_API. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9940319d6f9..6470cd87b4e 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -34,6 +34,8 @@ struct iommu_domain {
#define IOMMU_CAP_CACHE_COHERENCY 0x1
#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
+#ifdef CONFIG_IOMMU_API
+
struct iommu_ops {
int (*domain_init)(struct iommu_domain *domain);
void (*domain_destroy)(struct iommu_domain *domain);
@@ -49,8 +51,6 @@ struct iommu_ops {
unsigned long cap);
};
-#ifdef CONFIG_IOMMU_API
-
extern void register_iommu(struct iommu_ops *ops);
extern bool iommu_found(void);
extern struct iommu_domain *iommu_domain_alloc(void);
@@ -70,9 +70,7 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain,
#else /* CONFIG_IOMMU_API */
-static inline void register_iommu(struct iommu_ops *ops)
-{
-}
+struct iommu_ops {};
static inline bool iommu_found(void)
{