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: 102809 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp276230lbl; Thu, 11 Feb 2016 07:42:54 -0800 (PST) X-Received: by 10.98.71.130 with SMTP id p2mr67081435pfi.99.1455205374436; Thu, 11 Feb 2016 07:42:54 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si13214798pfo.227.2016.02.11.07.42.54; Thu, 11 Feb 2016 07:42:54 -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 S1751238AbcBKPmx (ORCPT + 1 other); Thu, 11 Feb 2016 10:42:53 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:56070 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbcBKPmw (ORCPT ); Thu, 11 Feb 2016 10:42:52 -0500 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 Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Paul Gortmaker , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , linux-mediatek@lists.infradead.org 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= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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(-) -- 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 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");