From patchwork Wed Sep 7 15:41:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 1127292 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p87G9DlA028114 for ; Wed, 7 Sep 2011 16:09:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756136Ab1IGQI5 (ORCPT ); Wed, 7 Sep 2011 12:08:57 -0400 Received: from va3ehsobe010.messaging.microsoft.com ([216.32.180.30]:33032 "EHLO VA3EHSOBE010.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756578Ab1IGQIu (ORCPT ); Wed, 7 Sep 2011 12:08:50 -0400 Received: from mail78-va3-R.bigfish.com (10.7.14.250) by VA3EHSOBE010.bigfish.com (10.7.40.12) with Microsoft SMTP Server id 14.1.225.22; Wed, 7 Sep 2011 15:42:08 +0000 Received: from mail78-va3 (localhost.localdomain [127.0.0.1]) by mail78-va3-R.bigfish.com (Postfix) with ESMTP id 1CA3AE01EB; Wed, 7 Sep 2011 15:42:08 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzzz1202hzz8275bhz32i668h839h65h) X-Spam-TCS-SCL: 4:0 X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI Received: from mail78-va3 (localhost.localdomain [127.0.0.1]) by mail78-va3 (MessageSwitch) id 1315410127814688_20182; Wed, 7 Sep 2011 15:42:07 +0000 (UTC) Received: from VA3EHSMHS007.bigfish.com (unknown [10.7.14.252]) by mail78-va3.bigfish.com (Postfix) with ESMTP id A12C3BB8052; Wed, 7 Sep 2011 15:42:07 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by VA3EHSMHS007.bigfish.com (10.7.99.17) with Microsoft SMTP Server id 14.1.225.22; Wed, 7 Sep 2011 15:42:04 +0000 X-WSS-ID: 0LR5SY2-01-4FP-02 X-M-MSG: Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com [163.181.249.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1) with ESMTP id 24E821028091; Wed, 7 Sep 2011 10:42:01 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep01.amd.com (163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.106.1; Wed, 7 Sep 2011 10:43:01 -0500 Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 7 Sep 2011 10:42:02 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.3.83.0; Wed, 7 Sep 2011 11:42:01 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id 3E0B049C62C; Wed, 7 Sep 2011 16:41:56 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 3551BFF918; Wed, 7 Sep 2011 17:41:56 +0200 (CEST) From: Joerg Roedel To: CC: Greg Kroah-Hartman , Alex Williamson , Ohad Ben-Cohen , David Woodhouse , David Brown , , , , Joerg Roedel Subject: [PATCH 10/10] iommu/core: Remove global iommu_ops and register_iommu Date: Wed, 7 Sep 2011 17:41:53 +0200 Message-ID: <1315410113-26608-11-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315410113-26608-1-git-send-email-joerg.roedel@amd.com> References: <1315410113-26608-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 07 Sep 2011 16:09:16 +0000 (UTC) With all IOMMU drivers being converted to bus_set_iommu the global iommu_ops are no longer required. The same is true for the deprecated register_iommu function. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 27 ++++----------------------- include/linux/iommu.h | 1 - 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index f2ced4c..82178cb 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -25,50 +25,31 @@ #include #include -static struct iommu_ops *iommu_ops; - -void register_iommu(struct iommu_ops *ops) -{ - if (iommu_ops) - BUG(); - - iommu_ops = ops; -} - void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops) { } bool iommu_present(struct bus_type *bus) { - if (bus->iommu_ops != NULL) - return true; - else - return iommu_ops != NULL; + return bus->iommu_ops != NULL; } EXPORT_SYMBOL_GPL(iommu_present); struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) { struct iommu_domain *domain; - struct iommu_ops *ops; int ret; - if (bus->iommu_ops) - ops = bus->iommu_ops; - else - ops = iommu_ops; - - if (ops == NULL) + if (bus->iommu_ops == NULL) return NULL; domain = kmalloc(sizeof(*domain), GFP_KERNEL); if (!domain) return NULL; - domain->ops = ops; + domain->ops = bus->iommu_ops; - ret = iommu_ops->domain_init(domain); + ret = domain->ops->domain_init(domain); if (ret) goto out_free; diff --git a/include/linux/iommu.h b/include/linux/iommu.h index de73219..7014f40 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -54,7 +54,6 @@ struct iommu_ops { unsigned long cap); }; -extern void register_iommu(struct iommu_ops *ops); extern void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops); extern bool iommu_present(struct bus_type *bus); extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);