Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp537043imu; Mon, 26 Nov 2018 14:37:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXoj11XNhg3aR+cfC1pMerwcR/ItfdBUUs4F/xKaweShPA+JQlqqu9pbXCFxJ8z+GPAIFJ X-Received: by 2002:a17:902:6848:: with SMTP id f8mr29180099pln.300.1543271832555; Mon, 26 Nov 2018 14:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543271832; cv=none; d=google.com; s=arc-20160816; b=pFGxEIr0JrQ3dpg+AaKdRf0xpftQi/Q2RvnJ4p0HUPR7I1UBTko2KeMwV1iqRaJVVz YRGti/8CHOWnvTH429mt/OC9RwG+MwPdW2i3snjnB1VndXyshpZG2NVhbzpZQ+9xGLRV eANAbuV9xiGG746GFgg+DGR7j8HINpKxbXYD4wVRd8E2urje/ogjYr4+42czn5OL4rzz wVPP9dzrTPBNBKxOiPCDfk8GK+xrnceqLQE3fsAO/AZbW4uWhrWAICuJO4QqSDlNmj28 NBOePTMvvP8Y5PyAxeRO6puGtQLTCzygalc8B6On5b1XpL1aimiWsUjVb46ErGA4VQzE X+wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=bgeQN/2FmQA3IUez4cvF4oLG/KHyp0IPH0ZSRE6JV3k=; b=o0SLTnEKRXQ1k+KT0QnTyfU2GV8FpIvc/A6tqthwT3mIL/S+qx0+7yxvgb+fFVp+oT KWE1X/AoIQnZP7s7umGfIinA5RQd5aoTWzYalmC63qiXJ4raMzahXkENw88OKw9+szJU 1grnTSHIIPhYLH8+PW/pSLDh1xadaDbDajycYZNSUiD/et6U5c9o6jsofTI1vJAt5gLL KmB/XhGc15Cb5i86UN7BnlkcYK9ia3e59vUv53I6Pyk8LuFy9/J39ezZXPn+hVvbtJB7 tCuj5wYwoyVmrYaxkiJ2OWlOmxzxc1+J7XQg4Jpo0wNs6I4zrw+fJwCc33qTUlnlfqcq 8VqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 102si395521plc.277.2018.11.26.14.36.57; Mon, 26 Nov 2018 14:37:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727360AbeK0JbL (ORCPT + 99 others); Tue, 27 Nov 2018 04:31:11 -0500 Received: from mail5.windriver.com ([192.103.53.11]:59846 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbeK0JbK (ORCPT ); Tue, 27 Nov 2018 04:31:10 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id wAQMXleL002240 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 26 Nov 2018 14:34:17 -0800 Received: from yow-cube1.wrs.com (128.224.56.98) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.408.0; Mon, 26 Nov 2018 14:34:08 -0800 From: Paul Gortmaker To: Joerg Roedel CC: , , Paul Gortmaker , Hiroshi Doyu , Stephen Warren , Thierry Reding , Alexandre Courbot , Subject: [PATCH 7/9] iommu: tegra-gart: make it explicitly non-modular Date: Mon, 26 Nov 2018 17:31:36 -0500 Message-ID: <1543271498-28966-8-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543271498-28966-1-git-send-email-paul.gortmaker@windriver.com> References: <1543271498-28966-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Kconfig currently controlling compilation of this code is: drivers/iommu/Kconfig:config TEGRA_IOMMU_GART drivers/iommu/Kconfig: bool "Tegra GART IOMMU Support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We replace module.h with moduleparam.h since the file does actually declare some module_param() and the easiest way to keep back compatibility with existing use cases is to leave it as-is for now. The init function was missing an __init annotation, so it was added. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Hiroshi Doyu Cc: Joerg Roedel Cc: Stephen Warren Cc: Thierry Reding Cc: Alexandre Courbot Cc: iommu@lists.linux-foundation.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/iommu/tegra-gart.c | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 7b1361d57a17..da6a4e357b2b 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -3,6 +3,8 @@ * * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved. * + * Author: Hiroshi DOYU + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. @@ -19,7 +21,8 @@ #define pr_fmt(fmt) "%s(): " fmt, __func__ -#include +#include +#include #include #include #include @@ -478,20 +481,6 @@ static int tegra_gart_probe(struct platform_device *pdev) return 0; } -static int tegra_gart_remove(struct platform_device *pdev) -{ - struct gart_device *gart = platform_get_drvdata(pdev); - - iommu_device_unregister(&gart->iommu); - iommu_device_sysfs_remove(&gart->iommu); - - writel(0, gart->regs + GART_CONFIG); - if (gart->savedata) - vfree(gart->savedata); - gart_handle = NULL; - return 0; -} - static const struct dev_pm_ops tegra_gart_pm_ops = { .suspend = tegra_gart_suspend, .resume = tegra_gart_resume, @@ -501,34 +490,22 @@ static const struct of_device_id tegra_gart_of_match[] = { { .compatible = "nvidia,tegra20-gart", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra_gart_of_match); static struct platform_driver tegra_gart_driver = { .probe = tegra_gart_probe, - .remove = tegra_gart_remove, .driver = { .name = "tegra-gart", .pm = &tegra_gart_pm_ops, .of_match_table = tegra_gart_of_match, + .suppress_bind_attrs = true, }, }; -static int tegra_gart_init(void) +static int __init tegra_gart_init(void) { return platform_driver_register(&tegra_gart_driver); } - -static void __exit tegra_gart_exit(void) -{ - platform_driver_unregister(&tegra_gart_driver); -} - subsys_initcall(tegra_gart_init); -module_exit(tegra_gart_exit); -module_param(gart_debug, bool, 0644); +module_param(gart_debug, bool, 0644); MODULE_PARM_DESC(gart_debug, "Enable GART debugging"); -MODULE_DESCRIPTION("IOMMU API for GART in Tegra20"); -MODULE_AUTHOR("Hiroshi DOYU "); -MODULE_ALIAS("platform:tegra-gart"); -MODULE_LICENSE("GPL v2"); -- 2.7.4