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: 8249511 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 70FF19F3CD for ; Mon, 8 Feb 2016 12:53:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BBFE203A9 for ; Mon, 8 Feb 2016 12:53:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8AC68202B8 for ; Mon, 8 Feb 2016 12:53:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSlK4-0002q9-0O; Mon, 08 Feb 2016 12:53:44 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSlJn-0002Z5-Lk; Mon, 08 Feb 2016 12:53:29 +0000 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 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160208_045328_197318_32B5B1B9 X-CRM114-Status: GOOD ( 15.24 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Redfearn , Paul Burton , Arnd Bergmann , Sascha Hauer , linux-kernel@vger.kernel.org, Paul Gortmaker , linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby , Matthias Brugger , Eddie Huang , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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