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: 102758 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp50194lbl; Wed, 17 Feb 2016 07:04:22 -0800 (PST) X-Received: by 10.98.33.70 with SMTP id h67mr2765802pfh.54.1455721462667; Wed, 17 Feb 2016 07:04:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ut6si2352986pac.241.2016.02.17.07.04.22; Wed, 17 Feb 2016 07:04:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-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-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965343AbcBQPEV (ORCPT + 1 other); Wed, 17 Feb 2016 10:04:21 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:49895 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965322AbcBQPES (ORCPT ); Wed, 17 Feb 2016 10:04:18 -0500 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 Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Paul Gortmaker , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Masahiro Yamada , Peter Hurley , Jiri Slaby , Matthias Brugger , Sascha Hauer , Eddie Huang , linux-mediatek@lists.infradead.org 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 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- drivers/tty/serial/8250/8250_mtk.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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");