From patchwork Thu Feb 11 15:41:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8281661 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 5522F9F3CD for ; Thu, 11 Feb 2016 15:43:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F67320306 for ; Thu, 11 Feb 2016 15:43:06 +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 8883D20225 for ; Thu, 11 Feb 2016 15:43:05 +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 1aTtOa-00032b-OP; Thu, 11 Feb 2016 15:43:04 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtOM-0002rH-Az; Thu, 11 Feb 2016 15:42:51 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Lj2j8-1Zrng02d02-00dDWe; Thu, 11 Feb 2016 16:42:14 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman , Matthias Brugger Subject: [PATCH v2 1/6] Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular" Date: Thu, 11 Feb 2016 16:41:27 +0100 Message-Id: <1455205297-1021302-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455205297-1021302-1-git-send-email-arnd@arndb.de> References: <1455205297-1021302-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:zjckD6Ht5EmK4Acru0EigXZU5kL1TRCS0RG2GboaAUzFSvyAl50 j/Da6DJc46XRskWQVCSvGeGednCs1LbAjniPRGxmUlg5q6eS6hpwGkQ2QEA9TbDGkDPfbcW +AO0QpeTrrE8ftV8Y6lLNXUxxycVhA0ThUK3IKZMmvNq41X7fXWkmdYwJns6i+dJA3wMqYx ed4GXoT8vXm+dAJ6Rsa5w== X-UI-Out-Filterresults: notjunk:1; V01:K0:JdcWguFvBNM=:ZZPBnlYLGUGZJ/Bub4FoSa a+aUe6qlwVoAeOsGeLaNQuWQM2E8PwrQ3nC9wBfe5mX2tL6xbiGoOUSUjGtI99XHh9iSNj4YL LE6xVkyL4oQVTGokoBwnoYurFOmC6oCfAECVyw7jNP+HdRz4BExSzl+cw3l/E4X1Wrx+K2j/1 Y20EDb3ru8isSTumV6cumuv0N8g6tE/umAyiAz66/7Nw5akjBNqckFnBF/p/R7UDdlJKjUlwN gECxhPk/+WfidwCz0yW73/cjKViG/HuJxlIVEGu0Hk9H6xXXQTWKph8tA55+SzFbIbBVEgGId KKoqUmgGym9o451ryKgRyNmnSFVJ2P+ec/T9xquww3UWcuYayMhWnFSdQ7kJrRrkdbM55kwXZ Ta7a7NGsb9vNN/isKQlPpubvqdX3hk5KOP2D5RUkhMFhHS+9l4mMVpEJkkywE/+52TQusIpbH djZJZV1dsXOfI9fK7P4CCYH06z+xbmE3q6Wf+GX80qhNB5WNEHnf4CanTSnF81vjj0IauXjVg zSW+YYCguYlTJiaCPpmrjb58Vu03UYte7ZOCZCpgsqjXHREgvDzBrLCbvlNoyZAyVmnYspvaL Y1JCx29cybQMyRgrjI973huJ9mwVybuttxUMRnnqZ/OsPiL9iTyw0DVa4BNzQnHHFFPR56oty QoB4zQqTFNyMyHGUf4iSiI1xURnFGeoXktmQHehjwGL0psaOdy5ZxhB9LzgtREUr2IQ4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_074250_761521_C31474D1 X-CRM114-Status: GOOD ( 15.19 ) X-Spam-Score: -2.6 (--) 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: Arnd Bergmann , linux-kernel@vger.kernel.org, Paul Gortmaker , linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby , 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.4 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, which tried to remove dead code but left the driver in a useless state when the main 8250 driver is a loadable module. 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 Fixes: d72d391c126e ("drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular") --- 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 0e590b233f03..78883ca64ddd 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; +} + #ifdef CONFIG_PM_SLEEP static int mtk8250_suspend(struct device *dev) { @@ -275,18 +292,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, @@ -302,3 +319,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");