From patchwork Sun Oct 18 22:21:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 7432401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C07B9F302 for ; Sun, 18 Oct 2015 22:25:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4251320642 for ; Sun, 18 Oct 2015 22:25:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E4712062A for ; Sun, 18 Oct 2015 22:25:22 +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 1ZnwLK-0007d7-NB; Sun, 18 Oct 2015 22:22:18 +0000 Received: from mail1.windriver.com ([147.11.146.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZnwLB-0007ZW-A0; Sun, 18 Oct 2015 22:22:10 +0000 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id t9IMLkU7028733 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 18 Oct 2015 15:21:46 -0700 (PDT) Received: from yow-lpgnfs-02.corp.ad.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.248.2; Sun, 18 Oct 2015 15:21:46 -0700 From: Paul Gortmaker To: Greg Kroah-Hartman Subject: [PATCH 5/5] drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular Date: Sun, 18 Oct 2015 18:21:18 -0400 Message-ID: <1445206878-12455-6-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445206878-12455-1-git-send-email-paul.gortmaker@windriver.com> References: <1445206878-12455-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151018_152209_376018_BAE4E433 X-CRM114-Status: GOOD ( 21.60 ) X-Spam-Score: -4.2 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Paul Gortmaker , linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby , Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The Kconfig currently controlling compilation of this code is: drivers/tty/serial/8250/Kconfig:config SERIAL_8250_MT6577 drivers/tty/serial/8250/Kconfig: bool "Mediatek serial port 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_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Matthias Brugger Cc: linux-serial@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Paul Gortmaker --- drivers/tty/serial/8250/8250_mtk.c | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 78883ca64ddd..0e590b233f03 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -16,7 +16,7 @@ */ #include #include -#include +#include #include #include #include @@ -245,23 +245,6 @@ static int mtk8250_probe(struct platform_device *pdev) return 0; } -static int mtk8250_remove(struct platform_device *pdev) -{ - struct mtk8250_data *data = platform_get_drvdata(pdev); - - pm_runtime_get_sync(&pdev->dev); - - serial8250_unregister_port(data->line); - - pm_runtime_disable(&pdev->dev); - pm_runtime_put_noidle(&pdev->dev); - - if (!pm_runtime_status_suspended(&pdev->dev)) - mtk8250_runtime_suspend(&pdev->dev); - - return 0; -} - #ifdef CONFIG_PM_SLEEP static int mtk8250_suspend(struct device *dev) { @@ -292,18 +275,18 @@ static const struct of_device_id mtk8250_of_match[] = { { .compatible = "mediatek,mt6577-uart" }, { /* Sentinel */ } }; -MODULE_DEVICE_TABLE(of, mtk8250_of_match); static struct platform_driver mtk8250_platform_driver = { .driver = { - .name = "mt6577-uart", - .pm = &mtk8250_pm_ops, - .of_match_table = mtk8250_of_match, + .name = "mt6577-uart", + .pm = &mtk8250_pm_ops, + .of_match_table = mtk8250_of_match, + .suppress_bind_attrs = true, + }, .probe = mtk8250_probe, - .remove = mtk8250_remove, }; -module_platform_driver(mtk8250_platform_driver); +builtin_platform_driver(mtk8250_platform_driver); #ifdef CONFIG_SERIAL_8250_CONSOLE static int __init early_mtk8250_setup(struct earlycon_device *device, @@ -319,7 +302,3 @@ static int __init early_mtk8250_setup(struct earlycon_device *device, OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup); #endif - -MODULE_AUTHOR("Matthias Brugger"); -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("Mediatek 8250 serial port driver");