From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754903Ab1IWPsv (ORCPT ); Fri, 23 Sep 2011 11:48:51 -0400 Received: from am1ehsobe001.messaging.microsoft.com ([213.199.154.204]:4892 "EHLO AM1EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752709Ab1IWPss (ORCPT ); Fri, 23 Sep 2011 11:48:48 -0400 X-SpamScore: 1 X-BigFish: VPS1(zzzz1202hzz8275bhz32i668h839h63h) X-Spam-TCS-SCL: 2:0 X-Forefront-Antispam-Report: CIP:163.181.249.108;KIP:(null);UIP:(null);IPVD:NLI;H:ausb3twp01.amd.com;RD:none;EFVD:NLI X-WSS-ID: 0LRZFSQ-01-1CT-02 X-M-MSG: From: Joerg Roedel To: CC: Greg Kroah-Hartman , Alex Williamson , Ohad Ben-Cohen , David Woodhouse , David Brown , , , Joerg Roedel Subject: [PATCH 01/10] iommu/core: Define iommu_ops and register_iommu only with CONFIG_IOMMU_API Date: Fri, 23 Sep 2011 17:45:47 +0200 Message-ID: <1316792756-3395-2-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316792756-3395-1-git-send-email-joerg.roedel@amd.com> References: <1316792756-3395-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes it impossible to compile an iommu driver into the kernel without selecting CONFIG_IOMMU_API. Signed-off-by: Joerg Roedel --- 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 9940319..6470cd8 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) { -- 1.7.4.1