From patchwork Mon Jan 26 23:51:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 5713441 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D0AEC058D for ; Mon, 26 Jan 2015 23:56:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5ECA8201BB for ; Mon, 26 Jan 2015 23:56:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85EFB201C8 for ; Mon, 26 Jan 2015 23:56:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFtWA-0001Tv-7R; Mon, 26 Jan 2015 23:56:30 +0000 Received: from 8bytes.org ([2a01:238:4383:600:38bc:a715:4b6d:a889] helo=theia.8bytes.org) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFtSi-0002LS-Gk; Mon, 26 Jan 2015 23:52:57 +0000 Received: by theia.8bytes.org (Postfix, from userid 1000) id DB2E6400; Tue, 27 Jan 2015 00:51:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1422316308; bh=yggJ58cPwNb7y8Xvhqocf9J41aW/WVk6zh01ugHK4wk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E2ctgVnH32yCpuVhfQ5PJq83zt/tkDyX8ncN1OPkpMt0GFu8Jfdn0QsHo8I8M+Y9q n6BL8GoHF9UsFy08bVCG+z5lIe7rhm7vD1rBl0Y/GXXPPmSWHlcDZh5BBXdQHXnyks LvVqCvdWAxBviqtOSNiizWxWj+c6xi+hsneAxJMpld1owAmxkUo1sA3sDXjjxrKNSA 8JexuLbZWfZOq6Miltanq0rQsJCi4GPtIlHrRvAnh7/NcwjkZCmFr46LltOF8BI4HZ v3FK3r9hBqQ35espGDXo+06NCNYHb425yA/DNe88BijERsB4lc2f1W1QBKSq/E73BI gWUHKixYKtCuA== From: Joerg Roedel To: iommu@lists.linux-foundation.org Subject: [PATCH 15/15] iommu: Remove domain_init and domain_free iommu_ops Date: Tue, 27 Jan 2015 00:51:45 +0100 Message-Id: <1422316305-19216-16-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422316305-19216-1-git-send-email-joro@8bytes.org> References: <1422316305-19216-1-git-send-email-joro@8bytes.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150126_155256_966070_03F952C2 X-CRM114-Status: GOOD ( 12.41 ) X-Spam-Score: -0.1 (/) Cc: Alexandre Courbot , linux-samsung-soc@vger.kernel.org, Heiko Stuebner , Arnd Bergmann , Stephen Warren , Joerg Roedel , Will Deacon , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Alex Williamson , Kukjin Kim , Thierry Reding , jroedel@suse.de, linux-tegra@vger.kernel.org, David Woodhouse , linux-arm-kernel@lists.infradead.org, Hiroshi Doyu X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joerg Roedel All drivers have been converted to the new domain_alloc and domain_free iommu-ops. So remove the old ones and get rid of iommu_domain->priv too, as this is no longer needed when the struct iommu_domain is embedded in the private structures of the iommu drivers. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 30 ++---------------------------- include/linux/iommu.h | 3 --- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index ab24d77..e66cc08 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -900,51 +900,25 @@ EXPORT_SYMBOL_GPL(iommu_set_fault_handler); struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) { - const struct iommu_ops *ops; struct iommu_domain *domain; if (bus == NULL || bus->iommu_ops == NULL) return NULL; - ops = bus->iommu_ops; - - if (ops->domain_alloc) - domain = ops->domain_alloc(IOMMU_DOMAIN_UNMANAGED); - else - domain = kzalloc(sizeof(*domain), GFP_KERNEL); - + domain = bus->iommu_ops->domain_alloc(IOMMU_DOMAIN_UNMANAGED); if (!domain) return NULL; domain->ops = bus->iommu_ops; domain->type = IOMMU_DOMAIN_UNMANAGED; - if (ops->domain_init && domain->ops->domain_init(domain)) - goto out_free; - return domain; - -out_free: - if (ops->domain_free) - ops->domain_free(domain); - else - kfree(domain); - - return NULL; } EXPORT_SYMBOL_GPL(iommu_domain_alloc); void iommu_domain_free(struct iommu_domain *domain) { - const struct iommu_ops *ops = domain->ops; - - if (likely(ops->domain_destroy != NULL)) - ops->domain_destroy(domain); - - if (ops->domain_free) - ops->domain_free(domain); - else - kfree(domain); + domain->ops->domain_free(domain); } EXPORT_SYMBOL_GPL(iommu_domain_free); diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 0b67f65..2951dca 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -62,7 +62,6 @@ enum iommu_domain_type { struct iommu_domain { enum iommu_domain_type type; const struct iommu_ops *ops; - void *priv; iommu_fault_handler_t handler; void *handler_token; struct iommu_domain_geometry geometry; @@ -122,8 +121,6 @@ enum iommu_attr { */ struct iommu_ops { bool (*capable)(enum iommu_cap); - int (*domain_init)(struct iommu_domain *domain); - void (*domain_destroy)(struct iommu_domain *domain); /* Domain allocation and freeing by the iommu driver */ struct iommu_domain *(*domain_alloc)(enum iommu_domain_type);