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: 8340091 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 8E8F19F372 for ; Wed, 17 Feb 2016 15:06:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48C0D203AB for ; Wed, 17 Feb 2016 15:06:10 +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 6B80320211 for ; Wed, 17 Feb 2016 15:06:09 +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 1aW3g8-00050B-Mh; Wed, 17 Feb 2016 15:06:08 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aW3fZ-0003kp-Kz; Wed, 17 Feb 2016 15:05:42 +0000 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 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160217_070534_487907_992BD1A5 X-CRM114-Status: GOOD ( 14.53 ) X-Spam-Score: -1.9 (-) 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: Heikki Krogerus , Peter Hurley , Arnd Bergmann , Paul Gortmaker , Sascha Hauer , linux-kernel@vger.kernel.org, Andy Shevchenko , Scott Wood , Paul Burton , Masahiro Yamada , Mans Rullgard , linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby , Matthias Brugger , Martin Sperl , 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.2 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': :(.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(-) 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