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"); From patchwork Wed Feb 17 15:02:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102759 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp50171lbl; Wed, 17 Feb 2016 07:04:21 -0800 (PST) X-Received: by 10.98.70.139 with SMTP id o11mr2723928pfi.123.1455721461188; Wed, 17 Feb 2016 07:04:21 -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.20; Wed, 17 Feb 2016 07:04:21 -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 S965326AbcBQPET (ORCPT + 1 other); Wed, 17 Feb 2016 10:04:19 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:50271 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965236AbcBQPES (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 0M36xf-1Zeux62F6d-00swyd; Wed, 17 Feb 2016 16:03:35 +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 , Matt Redfearn , Phillip Raffeck , Anton Wuerfel Subject: [PATCH v3 2/5] Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular" Date: Wed, 17 Feb 2016 16:02:32 +0100 Message-Id: <1455721357-4008289-3-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:UokaPyBkzosepw/V3hjwB9C6DR/uO8R6VZTWcF9t6cWru5z+1J1 FPXg67cjFFmLe7PMy/jR9ealCZe049NYlahRTAo49XCUghxsbSdP6Fb0prqC7C6coVYKlqf L1gDVdB0yX7iMsxKWtB0z4dAMhYSX7/jD3tM12CQEG2PKHp2JQ5sRH0Hoo8DYyydIZLZEvH AOvm583uqNeYCElncYBXw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Puox8Q5XQgc=:MbDy//xZFOCvYL5BrRFsdM xV5Kqh3pwHCFh5A3xk48yceKu5PtGQmXetGDnlTtpdV4tcZTgvNhkCR3R8b4yBwxZbU9D/RNZ blq12HklNWbrdQDkkhaOHqQ8fBUIksR3P4iT+0UnZOrIDNGzU+GGOV2KNmNqtYmYDyXGLrp3z 5OhKCIRBwzRsv+G6owkwgLyDvX7fBLXz72MchLFmfZx8sZ5mFfXVET3uKPX9TwnmwXvw4aBoI FpPT258hGEAOdwR+nHbLYDZJWQ3S75qtN2RtfCJr3vLZZj6u18nfAVwKjHtR2zQ/KbpeF/fgt Mk+/Y5BmQqr+Ypy9tsxxS+10hOHxR8+Xa4/xwM+7EoHKV39nWTwKdsdkK68SPrCupesv9p9k5 6yRtuQcpsIh8lXb6m82EpQw9EJuy7REn/H9y8+8jY2/RLFTacUAWBXT5BPVHlJZrd/eGPLcgn MWab93hxTsMnbekeot0TPoVHsMjdz8WFW+4X6ZfZSSHYZ2Dto+Ok4qe93uEvQNozS5eTOzS8n U1FWnY1R3bOJBYhwHEZX1HdpODgJm4e9V4H0u/Yy7fHs3qNerQTZjXeBnlDKkFE/Mm3mEv2ls SRBa8cnN+bCjYF8ptA09EYGhnu2BC/gsl3Z9h2vGqUEJAchar7F4sLQ1QBP/X86RygCvEEXhJ Jj7fgvCfUjH6qVxhFqoXEJc5dguGECTzb563lMuiiNlI5EX20nA4tAuLtK8uatpUPEx4= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This reverts commit cafe1ac64023 ("drivers/tty: make serial 8250_ingenic.c explicitly non-modular"), which attempted to remove dead code but did not have the desired effect when the main 8250 driver was a loadable 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_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 Wed Feb 17 15:02:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102756 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp50641lbl; Wed, 17 Feb 2016 07:05:04 -0800 (PST) X-Received: by 10.66.157.161 with SMTP id wn1mr2789957pab.146.1455721503931; Wed, 17 Feb 2016 07:05:03 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qc8si2469829pac.39.2016.02.17.07.05.03; Wed, 17 Feb 2016 07:05:03 -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 S965376AbcBQPFB (ORCPT + 1 other); Wed, 17 Feb 2016 10:05:01 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:58145 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965324AbcBQPE7 (ORCPT ); Wed, 17 Feb 2016 10:04:59 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0M3wRS-1Zfjud3SQU-00rZOk; Wed, 17 Feb 2016 16:04: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, Masahiro Yamada , Peter Hurley , Jiri Slaby , Matt Redfearn , Phillip Raffeck Subject: [PATCH v3 4/5] serial: 8250/ingenic: fix building with SERIAL_8250=m Date: Wed, 17 Feb 2016 16:02:34 +0100 Message-Id: <1455721357-4008289-5-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:kQ2Qg8RtkEZIvAA37xLn0UnPLTJlnt4vcZXOpvfqP21rnzzJbmt aGYGY1O55KTjST6eZnfUUuyhdN6Fxlc7RFymuyeC/i0VZkp35ZDZR1QOlJ1GCmaNLIgqajA DfCfukrJkBvr/WcEa6mlroFJV8dC/47f/BtEqkJe9GYxdXOauCd/MGTKPs5w74ja927a9HD HLz4v8gDPcNG0wh++4bwQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:md4rfhtcCp0=:QK2+B89KZxK6wswYfhASKl pOMr9xYlIw4Yvl9VSi0y3PftrQVG2ymrKfACoOx1Wiz6qdW6Ymhsq6K8UaQIvMN0qaLNmUzyR sKIFIuKkRiUtgW+Mq6DnEfnIJ2bLCwyv3vSVsTT6egDvfhmuGk0AA3avHGQNHZy+2+oNIT2xe q3UVLM0iujKGeqd75w77yGZYaE9EwIQ7C7WqEoORPX2R8bgxzZvczIY/FKZlyPG0fAXOS+Wos ISFJPtgomrNesvVYRRIfo+GSkkUBaNjyX3ru8d2plKMrc8LCEiP+FjkIvCW6gm2ZfSlGGGHqg YDKQIFvFN6d6LyZ9skTTiQuh4dO4gjjhAJmTjPDIbSZ3HsWdSrq613124d2ZwoDmdlbvyKc+t AXQeS82BbcqEIcJ1wyMg9q/iClqkg+WiweS3CuSkDielbymt+7SvBVqFNYNpYd4Eu5ftTBYr9 FweegE1wTQqU+lBTOunfruiCipY/NQEWbMSkpcEPL2ub2OMKCwI8DSoHEGo4jOCX47DMKkniD nL/XmGUwqTdJnCZ8Yuy9XILMuM5E89ZNjstoY3EMpcA+aclcxYj/olzU7eR+orz6oLmn9WsXn 3I7WlbWJfx28BoVeACotW+kXVlSdn2KRJHRhbJ3RnwMVCKHQI6RKY/Zd+kLiRgdJkKRUeQGY/ OjMZPx+Qba/UFX2RYRCbzmETOGCRVpHeCK4fZk8WMtXWPGPv22LdA6RkCn7rD5z3F+z0= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The Ingenic 8250 driver has a 'bool' Kconfig symbol, but that breaks when SERIAL_8250 is a loadable module: drivers/tty/built-in.o: In function `ingenic_uart_probe': 8250_ingenic.c:(.text+0x1c1a0): undefined reference to `serial8250_register_8250_port' This changes the symbol to a 'tristate', plus a dependency on SERIAL_8250, which makes it work again. Unlike the other soc-specific backends, this one has no dependency on an architecture or a platform. I'm adding a dependency on MIPS || COMPILE_TEST as well here, to avoid showing the driver on architectures that are not interested in it. Signed-off-by: Arnd Bergmann --- drivers/tty/serial/8250/8250_ingenic.c | 2 +- drivers/tty/serial/8250/Kconfig | 7 ++++--- 2 files changed, 5 insertions(+), 4 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 97b78558caed..b0677f610863 100644 --- a/drivers/tty/serial/8250/8250_ingenic.c +++ b/drivers/tty/serial/8250/8250_ingenic.c @@ -48,7 +48,7 @@ static const struct of_device_id of_match[]; #define UART_MCR_MDCE BIT(7) #define UART_MCR_FCM BIT(6) -#ifdef CONFIG_SERIAL_EARLYCON +#if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE) static struct earlycon_device *early_device; static uint8_t __init early_in(struct uart_port *port, int offset) diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index 67ad6b0d595b..1b0638511ac1 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -384,9 +384,10 @@ config SERIAL_8250_UNIPHIER serial ports, say Y to this option. If unsure, say N. config SERIAL_8250_INGENIC - bool "Support for Ingenic SoC serial ports" - depends on OF_FLATTREE - select LIBFDT + tristate "Support for Ingenic SoC serial ports" + depends on SERIAL_8250 + depends on (OF_FLATTREE && SERIAL_8250_CONSOLE) || !SERIAL_EARLYCON + depends on MIPS || COMPILE_TEST help If you have a system using an Ingenic SoC and wish to make use of its UARTs, say Y to this option. If unsure, say N. From patchwork Wed Feb 17 15:02:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102755 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp51111lbl; Wed, 17 Feb 2016 07:05:45 -0800 (PST) X-Received: by 10.98.9.27 with SMTP id e27mr2761926pfd.59.1455721545829; Wed, 17 Feb 2016 07:05:45 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hc1si2490054pac.16.2016.02.17.07.05.45; Wed, 17 Feb 2016 07:05:45 -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 S965392AbcBQPFo (ORCPT + 1 other); Wed, 17 Feb 2016 10:05:44 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:49304 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965324AbcBQPFn (ORCPT ); Wed, 17 Feb 2016 10:05:43 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0MH3Pq-1ajrRX3k6U-00Dma2; Wed, 17 Feb 2016 16:04:40 +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 , Heikki Krogerus , Andy Shevchenko , Martin Sperl , Paul Burton , Mans Rullgard , Scott Wood , linux-mediatek@lists.infradead.org Subject: [PATCH v3 5/5] serial: 8250/mediatek: fix building with SERIAL_8250=m Date: Wed, 17 Feb 2016 16:02:35 +0100 Message-Id: <1455721357-4008289-6-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:6zsR31QYqQcnBbjGVYMeM9LCVb9qEmTzLIuJd5kc8FVwehds5Wa oy6LN+7+75D/8BCMumaUW/P+EE5NUpIaH38n/KbbGuAAD+YGbMZMzLJV+8WuVBlO0ydMNVb fTIOUAO4s52tmUISYau8paLFqVzPMJrIKsnYhjdkL5N2spte3N7eeDgkp6mkCqIFxjv6/jc 46OucOJOO29LFKTqwEisQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:nhwzOhcYf8g=:Ut5+YdrWAkNnRvHp63rGVh y3zVV2P3GCTmOB6Kx0zmsiaKLgoQdncAdt+zQT0hhy7aIGskqBUgkecRSvjuMG956GuNXEJ8M 9uM8O/f6cNzObKAaBc6u90HZzAllrjpL6Cq3cwhsUGNDdvpK8iGPFDwcNjLAxAhFhQN04jNee DBLSzfbyBL5tHWfOe9qFlcqx4RKEuA8jbeeB4xI9mVZsUXhAVLvcA5AHy7QR/pkP7jNDl5ANF CJ2YewU1ifry7ibsFVO+4sX531++YUAlCGqleQUhcFPCDb4hW+WsNmqQ+pCXJ4ZDS9SAjQWjC lWk+7gIQcs7ucukDoaGSacjTqTE4R76XQWy/zlB1pk4cQVPh+n75mB6+NYUWlS/etlfJxkfHZ 6vFXqHnCo4RpH32+hdpcHKkQFTy5j2KcktTveyKLibJx8lTr9xPe7DNjMW/d2jekHF5fkPxjb tCM2YS0Y0SZJkisaPgzesXZLDfzXqT+qrK0Sf/whpQYVJ3g24Ae583CK5ophNYfGPLMkZ/pa2 rjYgHOpDSPcWVpDfauU5btMhGixhky8kU3YM+4S+Ua5bb758ib0HONumCPiyt4aakYxxAQlLC 2BOqx3Cs/kXodMHB2CvtWtOsEDzvcOlv8fP8mPEZUz5QwDFpkTS8S+xnPpKKGw4VmjIvI+zUp Gxm0pkCeQfLS9R840BRpuxKhfIgc32yn6mRD67eryzNrLrXGNc3G0gf+NzqGPXX8g7vg= 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 Acked-by: Matthias Brugger --- drivers/tty/serial/8250/8250_mtk.c | 2 +- drivers/tty/serial/8250/Kconfig | 2 +- 2 files changed, 2 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..a0294f3de4f8 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -303,7 +303,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 1b0638511ac1..c45a02a7f9e2 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