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