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"); From patchwork Thu Feb 11 15:41:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102808 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp276791lbl; Thu, 11 Feb 2016 07:43:40 -0800 (PST) X-Received: by 10.66.141.11 with SMTP id rk11mr65034302pab.156.1455205411587; Thu, 11 Feb 2016 07:43:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m81si13236001pfi.201.2016.02.11.07.43.31; Thu, 11 Feb 2016 07:43:31 -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 S1750983AbcBKPna (ORCPT + 1 other); Thu, 11 Feb 2016 10:43:30 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:49330 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbcBKPn3 (ORCPT ); Thu, 11 Feb 2016 10:43:29 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MBTfC-1aKVij22g2-00AVTQ; Thu, 11 Feb 2016 16:42:47 +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, Jiri Slaby , Matt Redfearn , Paul Burton Subject: [PATCH v2 2/6] Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular" Date: Thu, 11 Feb 2016 16:41:28 +0100 Message-Id: <1455205297-1021302-3-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:35z6fSZPKrv5kWLa6o0Zj3uqFBCiWRbVlfZgDqLa34aTf3WbcKk X2Dncv0qkO8WmAhoUr4yf47WkXihSkxcGxvfgXUdBCxXyS3XZ8Pd2Eo2rilTfOjQodzlDqw t6VYnNusMfN+4gbramF/u07V+CZ+NRYaqoSl5uBmMCu4LdIPSnndm672IdYuLSCzj7098o2 jEOB7v8/P+s/P1jzM4CKg== X-UI-Out-Filterresults: notjunk:1; V01:K0:TXeEW/6/1cg=:j92GORvBtRgic9qKR8DXmU pd94VZDgccgcXMyFD7q9qVFThXeOq5ferUqsFisa4c4hivZu7CMixwOlJTMjUw5IEAX35Kr0E RlRlmRvKW/xQQ0Pd6Zep/wvvVAQjh23mKW5vvu7zIQj19e/nHa4DBeJnbAki6rG8Q+tg0R5V3 v3oPyii3fK6lxjib6ceNAAz6J/JJBPNwCLnFao8PC31uIABzIJkLsZtvwFyYlh85FQsDrxUvE 38ZqrBKW6QGItxxESD9b6KruGPeNCO2YLB1qfl0iuC43vXZFrwKd1atcrryJBB5EB38F73CfX KQQZ2srpJrbuiCJOvUGvP5V8P5gTiodkzaQdLJl51v5V/43k7sbrSWW2rOROhkxn4pLflf28I wESWDV5qu87roDj0xu6wU1/nXD6FgLurwTsAeLfNVi3ZMGasq8Z2SCpwDKOZeM36h1iQ8sAq1 2WLOW0hG5UrlFu9lgPQVsEMRDOQ9C8GVW0KPI/VRlSyK4CEWmoL3KLn2UMyFIHW+ZFN/ojYfK PSKngPgL7c3Oj6QjGJp/6CTV6FUfPfM9+k+0cOBC+S3hKVW1+PsrwSCqc927B471PH5bDzqLh f4ykcGKtjD7CY1zMHaFCD+p4iJR8acaC3ghpfuoRItDHqKEqfIZTVN/jAb5A8lttq2OU5tj64 rplHRPWTFkDJL1XKCxjAQomzS4NpFhEJcY+BF4ZADLlDB755czYDlV69AgCoYvhAt6q8= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This reverts commit cafe1ac64023, 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: cafe1ac64023 ("drivers/tty: make serial 8250_ingenic.c explicitly non-modular") --- drivers/tty/serial/8250/8250_ingenic.c | 28 +++++++++++++++++++++------- 1 file changed, 21 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_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c index b4e1d39805b2..97b78558caed 100644 --- a/drivers/tty/serial/8250/8250_ingenic.c +++ b/drivers/tty/serial/8250/8250_ingenic.c @@ -4,8 +4,6 @@ * * Ingenic SoC UART support * - * Author: Paul Burton - * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -20,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -303,6 +301,16 @@ out: return err; } +static int ingenic_uart_remove(struct platform_device *pdev) +{ + struct ingenic_uart_data *data = platform_get_drvdata(pdev); + + serial8250_unregister_port(data->line); + clk_disable_unprepare(data->clk_module); + clk_disable_unprepare(data->clk_baud); + return 0; +} + static const struct ingenic_uart_config jz4740_uart_config = { .tx_loadsz = 8, .fifosize = 16, @@ -325,13 +333,19 @@ static const struct of_device_id of_match[] = { { .compatible = "ingenic,jz4780-uart", .data = &jz4780_uart_config }, { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, of_match); static struct platform_driver ingenic_uart_platform_driver = { .driver = { - .name = "ingenic-uart", - .of_match_table = of_match, - .suppress_bind_attrs = true, + .name = "ingenic-uart", + .of_match_table = of_match, }, .probe = ingenic_uart_probe, + .remove = ingenic_uart_remove, }; -builtin_platform_driver(ingenic_uart_platform_driver); + +module_platform_driver(ingenic_uart_platform_driver); + +MODULE_AUTHOR("Paul Burton"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Ingenic SoC UART driver"); From patchwork Thu Feb 11 15:41:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102807 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp277119lbl; Thu, 11 Feb 2016 07:44:08 -0800 (PST) X-Received: by 10.67.14.234 with SMTP id fj10mr67078996pad.149.1455205440387; Thu, 11 Feb 2016 07:44:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c77si13235801pfj.246.2016.02.11.07.44.00; Thu, 11 Feb 2016 07:44:00 -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 S1751215AbcBKPn7 (ORCPT + 1 other); Thu, 11 Feb 2016 10:43:59 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:61644 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbcBKPn6 (ORCPT ); Thu, 11 Feb 2016 10:43:58 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MZUYX-1aiWX813gT-00LGy7; Thu, 11 Feb 2016 16:43:07 +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, Jiri Slaby , Matthias Brugger , Sascha Hauer , Eddie Huang , linux-mediatek@lists.infradead.org Subject: [PATCH v2 3/6] serial: 8250/mediatek: mark PM functions as __maybe_unused Date: Thu, 11 Feb 2016 16:41:29 +0100 Message-Id: <1455205297-1021302-4-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:Uux6EYeZbOAJIu02O2PdNWktmCYNFsr8C6GcTxe0+l1w13mFDet 4evJ5zbbQISpjTrQCG6dBVDNNLWrAgoMycSyfhLlKFMJG+BP33dEY4klvJxbws6Pfnspx1s FBywA2qG/IR1u/VrWe1IRhPc+uvllhHMmgIVpaxnN04NS74iOcKhHvCkI3ZU9WyzOdV7N95 ghf+SGg6laWordHT/djlg== X-UI-Out-Filterresults: notjunk:1; V01:K0:Oo0nidqwPZU=:RsGoEmbzh+3CM/ZJITMqK7 cTuCgAqnutl3Jp110sg/flKfZ210Xkhlr2DHjZpPkgyeC4rebAucq41AwXZRaWxFXOzLiOzQu 7UQ8WIO5o12+lTndwGNJUcof0efLRxN2uD2iqe3XYG2vfQLNMMydQqvbA1X2MswBPOxSMCS60 MLoWDRO9JmSHmMbp/tSTgxNyMtCBTSoFZXCJt3T524GaH+qGR2bnfeGI/GSuRqKCdxth4VI/U 796PXxNfah3azU0C1SMv9jH09Gr32VK0GzWkb0eiexiFXnO3Av9zzd5q0paUKewfamChCEOOV t0wpH60QsTn2HfTRoRJu1px+zWLpDbYTR+19zlIKZM5p7Kqixv2Xw5+dm/iu924LSKG/+uPH2 NzoJDaLI/R8uqKYAZnCMavC8FNibBVzsbQPcMzJb3g3RL5TxhaBYV7zelNUODjfKEIVqMFeIN XPZ6mfQEOxt4ozKG73GaqTB+TwC48A4herKS8ktWdvtiKeZAkEGN8/dgXz1VSubeqW4wliJCm MZAxd/uoQQ5F0OC6rXXaNXF6HPbos+nrE20vz5dpFv13f6cBB6SwBByNdbDeVaanIZ0syj2Pw vetl/3NhHJ5G3IQJ0SVxryTYDhn0Ieivyss4Hf7V6/MTOS26YVAMfiHU0V3R1BFHAQRKeCSuf /Ws0gp27yS3DK3ZlYs0ovR8dlm1OtJ4r/YxpbNE+xmz+c3n0551wSq5w49Ao5pG6S8z4= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The mtk8250_runtime_suspend function is not used when runtime PM is disabled, so we get a warning about an unused function: drivers/tty/serial/8250/8250_mtk.c:119:12: error: 'mtk8250_runtime_suspend' defined but not used [-Werror=unused-function] static int mtk8250_runtime_suspend(struct device *dev) This marks all the PM functions as __maybe_unused to avoid the warning, and removes the #ifdef around the PM_SLEEP functions for consistency. Signed-off-by: Arnd Bergmann Acked-by: Matthias Brugger --- drivers/tty/serial/8250/8250_mtk.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 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 78883ca64ddd..6ecc6e3e82dc 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -116,7 +116,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, tty_termios_encode_baud_rate(termios, baud, baud); } -static int mtk8250_runtime_suspend(struct device *dev) +static int __maybe_unused mtk8250_runtime_suspend(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -126,7 +126,7 @@ static int mtk8250_runtime_suspend(struct device *dev) return 0; } -static int mtk8250_runtime_resume(struct device *dev) +static int __maybe_unused mtk8250_runtime_resume(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); int err; @@ -262,8 +262,7 @@ static int mtk8250_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int mtk8250_suspend(struct device *dev) +static int __maybe_unused mtk8250_suspend(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -272,7 +271,7 @@ static int mtk8250_suspend(struct device *dev) return 0; } -static int mtk8250_resume(struct device *dev) +static int __maybe_unused mtk8250_resume(struct device *dev) { struct mtk8250_data *data = dev_get_drvdata(dev); @@ -280,7 +279,6 @@ static int mtk8250_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops mtk8250_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mtk8250_suspend, mtk8250_resume) From patchwork Thu Feb 11 15:41: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: 102805 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp277861lbl; Thu, 11 Feb 2016 07:45:18 -0800 (PST) X-Received: by 10.98.15.145 with SMTP id 17mr60563263pfp.19.1455205506510; Thu, 11 Feb 2016 07:45:06 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si13232635pat.171.2016.02.11.07.45.06; Thu, 11 Feb 2016 07:45:06 -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 S1751395AbcBKPpF (ORCPT + 1 other); Thu, 11 Feb 2016 10:45:05 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:52954 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbcBKPpD (ORCPT ); Thu, 11 Feb 2016 10:45:03 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0M6UrD-1a6Sk605ut-00yRH7; Thu, 11 Feb 2016 16:44:17 +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, Jiri Slaby , Matthias Brugger , Sascha Hauer , Eddie Huang , Masahiro Yamada , linux-mediatek@lists.infradead.org Subject: [PATCH v2 5/6] serial: 8250/mediatek: fix building with SERIAL_8250=m Date: Thu, 11 Feb 2016 16:41:31 +0100 Message-Id: <1455205297-1021302-6-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:4DJ2PhjZxFkMWb8lU72kFKrUd4wy4lieWU5P1HX/g8kIRFsLw/i c/c8As2Q7uNRr9qcYsqc2QE8+ONWJ8IUPk50vS+EmTJaDKh6YSQz+PlOwg5s7WyKiWZNDwW wc11oTmLcino9eK7M+nUmv9gMh/304oIYHJxRtnLhQGH2XqCFVabYtPvbzSwoeJknteDFUg 2/TIjbnIJhue1ClezqO8A== X-UI-Out-Filterresults: notjunk:1; V01:K0:PE9/9GzqbjQ=:qjs27ju8Wpj8uxPTeBT/m5 rnfcNFKC7X3JNCOIchVwW4ZSDa4F9PYmhMz9wHnoxMBOnAPSPXrjcyzNXVzoGsdFZ1scLK1x3 WWUjoKF/7LaTiwFq7fzt5SpSo4/sO6bilW/RW0EZDEV3cu151uEcJD9NPGdwH8+4xxN4FkYLr Jc4wiKlq1FNUX+olvZ2kixRVqs9gYvFXmm4js80FHO7saQ1dn6v+qW9MiqOVVBD74vBpxVmol NmmIsBscDeFHShhED15twfflNJAIa9qY0XW/7VmRAwVo6nYmhE3Jo68709ktNA+UOVPu/eAYd gxymxMjb9P5jEQ1QY1ZA+M7ZeJjItmtwywe6gJ3tIYNEvpP8a2207CMkwrK6AuWtVV2S4M1f4 pgeWLXg71h2OzAyo6PsLSC9X7d05N1akET3Zn7CbXbp5QBpSS4duAWju7n8TPda+f55kTwCQ1 c911x7UsZcq65rb4aS6BSJhxqdfiCXgMkoHAnH14Gtk6BVI5T54yk77HEOk4dJXMGYrgRC7X2 9StFnnjlkRZiRVVUmv7A2ClcVF/cTSuW+n74ApmEUowXmub1RR13FWy1h6sPyL4sevXXiW7lz rD5Jg4vT0PXTUN24EJbr9WK77rQ7R0JIY/vSujZmKZKWocVWD5CESRpUn+BzofgCAtb3Rlfhh 74zg5fjmmJbNu9ZVY4y4NXOdzQmJcl6k/wrywgGDMcxA0WgFCL5YdkqJzO4h1SybXJV4= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that breaks when SERIAL_8250 is a loadable module: drivers/tty/built-in.o: In function `mtk8250_set_termios': :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' :(.text+0x1bf10): undefined reference to `uart_get_baud_rate' :(.text+0x1c09c): undefined reference to `uart_get_divisor' drivers/tty/built-in.o: In function `mtk8250_do_pm': :(.text+0x1c0d0): undefined reference to `serial8250_do_pm' drivers/tty/built-in.o: In function `mtk8250_probe': :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port' serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror] serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function] This changes the symbol to a 'tristate', so the dependency on SERIAL_8250 also works when that is set to 'm'. To actually build the driver, we also need to include . Signed-off-by: Arnd Bergmann --- drivers/tty/serial/8250/8250_mtk.c | 3 ++- drivers/tty/serial/8250/Kconfig | 2 +- 2 files changed, 3 insertions(+), 2 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 6ecc6e3e82dc..55be90c1d85e 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -303,7 +304,7 @@ static struct platform_driver mtk8250_platform_driver = { }; module_platform_driver(mtk8250_platform_driver); -#ifdef CONFIG_SERIAL_8250_CONSOLE +#if defined(CONFIG_SERIAL_8250_CONSOLE) && !defined(MODULE) static int __init early_mtk8250_setup(struct earlycon_device *device, const char *options) { diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index 67ad6b0d595b..6ae0fae4f796 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -370,7 +370,7 @@ config SERIAL_8250_LPC18XX serial port, say Y to this option. If unsure, say Y. config SERIAL_8250_MT6577 - bool "Mediatek serial port support" + tristate "Mediatek serial port support" depends on SERIAL_8250 && ARCH_MEDIATEK help If you have a Mediatek based board and want to use the