aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-09-06 10:48:40 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-10-21 08:37:18 -0400
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 9940319d6f9d..6470cd87b4ea 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -34,6 +34,8 @@ struct iommu_domain {
34#define IOMMU_CAP_CACHE_COHERENCY 0x1 34#define IOMMU_CAP_CACHE_COHERENCY 0x1
35#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ 35#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
36 36
37#ifdef CONFIG_IOMMU_API
38
37struct iommu_ops { 39struct iommu_ops {
38 int (*domain_init)(struct iommu_domain *domain); 40 int (*domain_init)(struct iommu_domain *domain);
39 void (*domain_destroy)(struct iommu_domain *domain); 41 void (*domain_destroy)(struct iommu_domain *domain);
@@ -49,8 +51,6 @@ struct iommu_ops {
49 unsigned long cap); 51 unsigned long cap);
50}; 52};
51 53
52#ifdef CONFIG_IOMMU_API
53
54extern void register_iommu(struct iommu_ops *ops); 54extern void register_iommu(struct iommu_ops *ops);
55extern bool iommu_found(void); 55extern bool iommu_found(void);
56extern struct iommu_domain *iommu_domain_alloc(void); 56extern struct iommu_domain *iommu_domain_alloc(void);
@@ -70,9 +70,7 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain,
70 70
71#else /* CONFIG_IOMMU_API */ 71#else /* CONFIG_IOMMU_API */
72 72
73static inline void register_iommu(struct iommu_ops *ops) 73struct iommu_ops {};
74{
75}
76 74
77static inline bool iommu_found(void) 75static inline bool iommu_found(void)
78{ 76{