diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2011-09-06 16:48:40 +0200 |
---|---|---|
committer | Hiroshi DOYU <hdoyu@nvidia.com> | 2012-01-23 11:11:34 +0200 |
commit | 6264ec29d5b6584b585ff04b816950784ec7e1f8 (patch) | |
tree | 4577439406913b6057808e3919bc5035de393eb4 | |
parent | 5d6d6265c965d437adc079310eb12545d04195db (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>
-rw-r--r-- | include/linux/iommu.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index ddad0ae0a433..67409b5633be 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -43,6 +43,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); @@ -58,8 +60,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); @@ -120,9 +120,7 @@ static inline int report_iommu_fault(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) { |