From patchwork Wed Feb 17 15:02:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8340021 Return-Path: X-Original-To: patchwork-linux-mediatek@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 1FEC19F372 for ; Wed, 17 Feb 2016 15:04:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 947F2203DB for ; Wed, 17 Feb 2016 15:04:34 +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 8E9C1203AB for ; Wed, 17 Feb 2016 15:04: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 1aW3eX-0002if-Kh; Wed, 17 Feb 2016 15:04:29 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aW3eI-0002Qv-VH; Wed, 17 Feb 2016 15:04:17 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0M3fC1-1ZfSwh33Jp-00rIY5; Wed, 17 Feb 2016 16:03:10 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Subject: [PATCH v3 1/5] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" Date: Wed, 17 Feb 2016 16:02:31 +0100 Message-Id: <1455721357-4008289-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455721357-4008289-1-git-send-email-arnd@arndb.de> References: <1455721357-4008289-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:zbmZxytmqUvV6zU5PYHeJj/ZmMEA8pq2XLt5qXh3RAocGz8tcI3 efgyCxkMxs86U9LuzkzvItovJ5elWSIZdfv5bUjOVPoAsYImATIvMt4mQDaGHjxeO3B7UN0 wt1tIX4r43VtSAXBMOn1PEglRsywgOYnl8AwE58PZrd44Nuzwg/a/DMv0Bt0jujohXOkIUh z7/p7a0dAZe17qDvFR5PA== X-UI-Out-Filterresults: notjunk:1; V01:K0:DvpfLHzLijo=:ey3KFuOtN0wS0PKG6l3kg5 KEt2olKrjbtriG99AONniJssXqQub6+eH6FQNWQae8Q1qgn85dXRXuM7wknKxqGJd+pTOdDmK rrPnr3qiynZwVnsfI366jOXebpKSMRvuxIBayvOmL/QwD1wWRG4KeuYo/6q1bXqING5OHieW3 +r8ujyYVDYhufVyBJAaekJ8ufyN6qkcBokrb5NrDCbXLg1zwLzFD4WHQVfgkU1LMHDwRWapxJ bDCwy6RkrQkcOTdwzJ0uFAWJemYPE29JbOahI4Z/DzTAlYlWzZxe8RyKQcojqLsSYZHdyEZVk E58IuqbGlci+5k26JI03ljO3MnMpXd8mojr1Kz+tk7fHRWCzYpsGtR2oa7t4ft48Ptmc4jxE+ 5Q3T+Up/dr140aTNYxfDj4diBtnW2CD6C8NFRuX0TH62OaBFxkmlhc+1wtbLz5D/QJK6vgx8c t3Btx1+uqdwFRcxqpuSbU0hWsTBU7BuGktyj7yYmKtrf+lIdyy0OVVfwC30sYmT4HncH13x9x Vc9Uk9pe1632wGBxeB0BRMVFrCM2pcw/Y1ZDskbHnhAmewPV+qa50DRLbHMVUljBd9NG6ZMXc elsNjVbe6KrpSaH+sxdtg4kN3QBb1SUpS9u3Dyc8ig1OzJuHZvmZuPOyARCuf6xdRb3uDbP92 I3CYJ9PEzzvn1wVoMp2RIkCcevzSnEbZMMAWUHyq7sI4S4EW1q1DIBpStTcSUG+wiETtgBQca g84uh+IqAgxWcVEe66TKfEKfHWde0inbIB3vB1hcx2etJNACjit09nV8i2H0h2ZuwpV2h+oaU msq8kW3l/xmxqVR7snGI6nrqYP3SQVas6l5hwXX9zgIMB7HZMGAmNjH24EKJl0Acj1Ibip7u0 lheXmr1ibFzDqlK49r08NAAbZwuWMj+sp1rm0dCWNHClQZW9691XNVzA7bOb1M X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160217_070415_499104_11E9207C X-CRM114-Status: GOOD ( 16.20 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Hurley , Arnd Bergmann , Paul Gortmaker , Sascha Hauer , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby , Matthias Brugger , Eddie Huang , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 This reverts commit d72d391c126e ("drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"), which intended to remove dead code but did not have the desired effect when the main 8250 driver was a module itself. This would normally result in a link error, but as the entire drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250 is set, we never notice that the driver does not get built in this configuration. Signed-off-by: Arnd Bergmann Acked-by: Matthias Brugger --- drivers/tty/serial/8250/8250_mtk.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 9038843cadc7..6ecc6e3e82dc 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,6 +245,23 @@ 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; +} + static int __maybe_unused mtk8250_suspend(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -273,18 +290,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, - .suppress_bind_attrs = true, - + .name = "mt6577-uart", + .pm = &mtk8250_pm_ops, + .of_match_table = mtk8250_of_match, }, .probe = mtk8250_probe, + .remove = mtk8250_remove, }; -builtin_platform_driver(mtk8250_platform_driver); +module_platform_driver(mtk8250_platform_driver); #ifdef CONFIG_SERIAL_8250_CONSOLE static int __init early_mtk8250_setup(struct earlycon_device *device, @@ -300,3 +317,7 @@ 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");