From patchwork Wed Feb 17 15:02:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102756 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp50641lbl; Wed, 17 Feb 2016 07:05:04 -0800 (PST) X-Received: by 10.66.157.161 with SMTP id wn1mr2789957pab.146.1455721503931; Wed, 17 Feb 2016 07:05:03 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qc8si2469829pac.39.2016.02.17.07.05.03; Wed, 17 Feb 2016 07:05:03 -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 S965376AbcBQPFB (ORCPT + 1 other); Wed, 17 Feb 2016 10:05:01 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:58145 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965324AbcBQPE7 (ORCPT ); Wed, 17 Feb 2016 10:04:59 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0M3wRS-1Zfjud3SQU-00rZOk; Wed, 17 Feb 2016 16:04: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, Masahiro Yamada , Peter Hurley , Jiri Slaby , Matt Redfearn , Phillip Raffeck Subject: [PATCH v3 4/5] serial: 8250/ingenic: fix building with SERIAL_8250=m Date: Wed, 17 Feb 2016 16:02:34 +0100 Message-Id: <1455721357-4008289-5-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:kQ2Qg8RtkEZIvAA37xLn0UnPLTJlnt4vcZXOpvfqP21rnzzJbmt aGYGY1O55KTjST6eZnfUUuyhdN6Fxlc7RFymuyeC/i0VZkp35ZDZR1QOlJ1GCmaNLIgqajA DfCfukrJkBvr/WcEa6mlroFJV8dC/47f/BtEqkJe9GYxdXOauCd/MGTKPs5w74ja927a9HD HLz4v8gDPcNG0wh++4bwQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:md4rfhtcCp0=:QK2+B89KZxK6wswYfhASKl pOMr9xYlIw4Yvl9VSi0y3PftrQVG2ymrKfACoOx1Wiz6qdW6Ymhsq6K8UaQIvMN0qaLNmUzyR sKIFIuKkRiUtgW+Mq6DnEfnIJ2bLCwyv3vSVsTT6egDvfhmuGk0AA3avHGQNHZy+2+oNIT2xe q3UVLM0iujKGeqd75w77yGZYaE9EwIQ7C7WqEoORPX2R8bgxzZvczIY/FKZlyPG0fAXOS+Wos ISFJPtgomrNesvVYRRIfo+GSkkUBaNjyX3ru8d2plKMrc8LCEiP+FjkIvCW6gm2ZfSlGGGHqg YDKQIFvFN6d6LyZ9skTTiQuh4dO4gjjhAJmTjPDIbSZ3HsWdSrq613124d2ZwoDmdlbvyKc+t AXQeS82BbcqEIcJ1wyMg9q/iClqkg+WiweS3CuSkDielbymt+7SvBVqFNYNpYd4Eu5ftTBYr9 FweegE1wTQqU+lBTOunfruiCipY/NQEWbMSkpcEPL2ub2OMKCwI8DSoHEGo4jOCX47DMKkniD nL/XmGUwqTdJnCZ8Yuy9XILMuM5E89ZNjstoY3EMpcA+aclcxYj/olzU7eR+orz6oLmn9WsXn 3I7WlbWJfx28BoVeACotW+kXVlSdn2KRJHRhbJ3RnwMVCKHQI6RKY/Zd+kLiRgdJkKRUeQGY/ OjMZPx+Qba/UFX2RYRCbzmETOGCRVpHeCK4fZk8WMtXWPGPv22LdA6RkCn7rD5z3F+z0= 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/8250_ingenic.c | 2 +- drivers/tty/serial/8250/Kconfig | 7 ++++--- 2 files changed, 5 insertions(+), 4 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_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c index 97b78558caed..b0677f610863 100644 --- a/drivers/tty/serial/8250/8250_ingenic.c +++ b/drivers/tty/serial/8250/8250_ingenic.c @@ -48,7 +48,7 @@ static const struct of_device_id of_match[]; #define UART_MCR_MDCE BIT(7) #define UART_MCR_FCM BIT(6) -#ifdef CONFIG_SERIAL_EARLYCON +#if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE) static struct earlycon_device *early_device; static uint8_t __init early_in(struct uart_port *port, int offset) diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index 67ad6b0d595b..1b0638511ac1 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -384,9 +384,10 @@ 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 - select LIBFDT + tristate "Support for Ingenic SoC serial ports" + depends on SERIAL_8250 + depends on (OF_FLATTREE && SERIAL_8250_CONSOLE) || !SERIAL_EARLYCON + depends on MIPS || COMPILE_TEST help If you have a system using an Ingenic SoC and wish to make use of its UARTs, say Y to this option. If unsure, say N.