From patchwork Mon Feb 8 12:51:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102837 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1418387lbl; Mon, 8 Feb 2016 04:53:32 -0800 (PST) X-Received: by 10.98.65.203 with SMTP id g72mr42171684pfd.44.1454936012699; Mon, 08 Feb 2016 04:53:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c77si36122986pfj.246.2016.02.08.04.53.32; Mon, 08 Feb 2016 04:53:32 -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 S1751486AbcBHMxb (ORCPT + 1 other); Mon, 8 Feb 2016 07:53:31 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:52095 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751185AbcBHMxa (ORCPT ); Mon, 8 Feb 2016 07:53:30 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MSYbs-1aclDV3gaS-00Rbjw; Mon, 08 Feb 2016 13:52:38 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Eddie Huang , Matthias Brugger , Sascha Hauer , Paul Gortmaker , Matt Redfearn , Paul Burton , Jiri Slaby , linux-serial@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] serial: 8250: fix building mediatek with SERIAL_8250=m Date: Mon, 8 Feb 2016 13:51:42 +0100 Message-Id: <1454935947-2743255-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:LufoAd6lE02hXU+2Rl6Un6jnTAmxhL540ElQ5i6drwXfFa7ICTU Uy1CFzCvUbF7UkCuzTVzdHC2cBNdap4J3yJqsBz2kufeVjALUOGbClYAXE7jldwByAfIpi/ DFFa4EKXH0HrqHpTbV8L0pQ1cyVb18D4qoGetJBSFDekG6H6WhwudI58d53m5VVWZ2TcIIh ddNkSum4TITbFUV2hvfgA== X-UI-Out-Filterresults: notjunk:1; V01:K0:cx9ln+ulU90=:LcyYbwqQBHBEwFqkPOlWre 1Jts4y4uF9IW0UKeSnr/KDe7nO7hEms6yKEPz+f0ubdezrml0X8JtG4C+mdusa2ADUzTJapcm 2QbNBfdS5D9iT1zxkuttPzQ/bs7RZNedIYFFmymiEoRAwOpW6gX84jI8UqTXxDvaX2Cplypud WVeTHPl23jHUIIHf2AiWP38imTjDZWfiDYUpTViips/boiau+/tatbPQ+1ZrViglsvRj1cjEa VP9XgNeDmgTTmFO3R+9SVYqi2q4m2cSYqllgbUO9TuvRLGh/mGRT1AlL3f1+GjyluEUwYbpQs ZAbE14WYSALifQEvU+ZBRMpbXApZAlgrjDIJo9Cnu/JfgnsRVmpjLEVSpmaXjcuKXx/xsZU0e 5OB7g1Q7l2cciyXGJ2kQHGx+Ghpml7h8djDBzgQHMgozANs5DoaNyOQxk5Ov+MNN/vXA4h1kf 7s9IdgIUrUnAYbeS9dwyVBFSjrNffg4z6Gq7t0sCOlTftszzxwo3NQZ0k6CHPHpN2+VjXNfcN 0tn93PlpsDG7uepFq9jPudXBJTGjzcO1pdXUyTJPEzVYULAA2ogG3j8BbYVt6MLMrQqYQzviY mCEqQekAkLxAA75u8k8Hxff1oCbm//PxziukztsbhlGvVstd/g4wtzSkcM9TQDANHzMdN2XE0 cdNrl16Ygz96zZ+95O9K+PMfRm2QXE75AJ772/z04cHZrItwEUoEHn4LDGXWmaEAqQ18= 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': 8250_ingenic.c:(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' 8250_ingenic.c:(.text+0x1bf10): undefined reference to `uart_get_baud_rate' 8250_ingenic.c:(.text+0x1c09c): undefined reference to `uart_get_divisor' drivers/tty/built-in.o: In function `mtk8250_do_pm': 8250_ingenic.c:(.text+0x1c0d0): undefined reference to `serial8250_do_pm' drivers/tty/built-in.o: In function `mtk8250_probe': 8250_ingenic.c:(.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 . Note that the driver uses builtin_platform_driver() and implements no .remove() callback, so unloading the module is not possible. Signed-off-by: Arnd Bergmann --- drivers/tty/serial/8250/8250_mtk.c | 1 + drivers/tty/serial/8250/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- 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..7e9242a5ddfe 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 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 From patchwork Mon Feb 8 12:51:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102836 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1418542lbl; Mon, 8 Feb 2016 04:53:51 -0800 (PST) X-Received: by 10.98.44.73 with SMTP id s70mr1297608pfs.2.1454936031837; Mon, 08 Feb 2016 04:53:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si46405193pap.212.2016.02.08.04.53.51; Mon, 08 Feb 2016 04:53:51 -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 S1753155AbcBHMxu (ORCPT + 1 other); Mon, 8 Feb 2016 07:53:50 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:51438 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799AbcBHMxt (ORCPT ); Mon, 8 Feb 2016 07:53:49 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MWPgw-1aVcbU00xm-00Xg0Y; Mon, 08 Feb 2016 13:53:02 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Eddie Huang , Matthias Brugger , Sascha Hauer , Paul Gortmaker , Matt Redfearn , Paul Burton , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] serial: 8250: fix building Ingenic with SERIAL_8250=m Date: Mon, 8 Feb 2016 13:51:43 +0100 Message-Id: <1454935947-2743255-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454935947-2743255-1-git-send-email-arnd@arndb.de> References: <1454935947-2743255-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:OsiPyREPSJdAALh6DuBHE7O2bt6fT7F4muqYcvrbbMqOBUXU+PR s5DcBXZuMYB32JkhtY+3K28Lu4vVebYm2S2Efev3VzXI+lFAMT0b8v/fPazI9dpLXR8Jwp4 M07NIxGcD14Z6sDVeIP5pc3+r6FnsFqbVG6wwaCM2HCVAb+Sd/Ah4PUsT2UjNEdP9whlV0z fIN8KGH+BQ8m9M9MLDDNg== X-UI-Out-Filterresults: notjunk:1; V01:K0:Wr3rFAIYlpQ=:X3vqhhk5TtzMvbusZad2Ln midNMU2R1ndiRQ57EI5c60UVDUS4u+tgL0AAIqiaMHzim2MZk+RWcAUFNZgkqrK4kEpvJpCGk vYGjLglU2b7GxXdFZFEBhyLCVUj8xhumJ8kBQishV5T9CmVhuuLRtJVrE/b2mMowFUHV3V1Pp pCPmpwcfXDqLPaFcI0z3/WcBeNarMJjcEVxdsIhR6iiasDfg3RnjzpBbzmdHje+g5pLBeEZHg t9K2HNNgcNFPQAun28TYK/SNkD9xF1L3jjKpiJg3HEvPukjiZd/NOFabcTM9ZSspxJBNzZXNy jGLsLeJfe2Sjz6bm9q7jxMBrxdNiXnw94dAvGT2/lQIzkz4fAZknORBwmgG/NXIb05/Pf7Fic qJ72bsDiRBEju4d6DD9+Okx0MwOnJEtONjkIoOBUVVBanYV52V4k9yoPRUPOYs+i4nOlpJm0J 3rRRHuEEJRwMNnvZhpc1/PKctGJUHdoBeVdn52TcazpFgJqfrNuPEYUbV7x4/SfGSUZp1r399 GhWyMSpdGkV20K4OCZo5cTM/c0VYjOyoKqJvBgPUGmTEZJ90WAob3u/qM6X9A2Q9AgU7/jtEO gr96SBHB5lLudGcmJazpMbXUUiq4d9qMdsvtHX/FQFBkGSWoHImESmWvSCxdqjWXO2Q3I4q4y +Yc1HJTcxkuWe56zNadtdrq7Bm4K60r0yi98SOYEXOtJx/O4mjGIrpUSbTU+zPooPaYo= 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/Kconfig | 4 ++-- 1 file 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/Kconfig b/drivers/tty/serial/8250/Kconfig index 6ae0fae4f796..13c63b14179f 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -384,8 +384,8 @@ 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 + tristate "Support for Ingenic SoC serial ports" + depends on SERIAL_8250 && OF_FLATTREE && (MIPS || COMPILE_TEST) select LIBFDT help If you have a system using an Ingenic SoC and wish to make use of