Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -5
+3 -5
include/linux/iommu.h
··· 34 34 #define IOMMU_CAP_CACHE_COHERENCY 0x1 35 35 #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ 36 36 37 + #ifdef CONFIG_IOMMU_API 38 + 37 39 struct iommu_ops { 38 40 int (*domain_init)(struct iommu_domain *domain); 39 41 void (*domain_destroy)(struct iommu_domain *domain); ··· 50 48 int (*domain_has_cap)(struct iommu_domain *domain, 51 49 unsigned long cap); 52 50 }; 53 - 54 - #ifdef CONFIG_IOMMU_API 55 51 56 52 extern void register_iommu(struct iommu_ops *ops); 57 53 extern bool iommu_found(void); ··· 70 70 71 71 #else /* CONFIG_IOMMU_API */ 72 72 73 - static inline void register_iommu(struct iommu_ops *ops) 74 - { 75 - } 73 + struct iommu_ops {}; 76 74 77 75 static inline bool iommu_found(void) 78 76 {