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