From patchwork Sat Jan 21 03:50:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 137142 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id C0AFF100A90 for ; Sat, 21 Jan 2012 14:50:57 +1100 (EST) Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.windriver.com", Issuer "Intel External Basic Issuing CA 3A" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6DD1DB6EF2 for ; Sat, 21 Jan 2012 14:50:45 +1100 (EST) Received: from yow-lpgnfs-02.corp.ad.wrs.com (yow-lpgnfs-02.ottawa.windriver.com [128.224.149.8]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id q0L3odHG006220; Fri, 20 Jan 2012 19:50:39 -0800 (PST) From: Paul Gortmaker To: benh@kernel.crashing.org, paulus@samba.org Subject: [PATCH] powerpc: dont include 8250 pre-setup if 8250 driver isn't enabled. Date: Fri, 20 Jan 2012 22:50:28 -0500 Message-Id: <1327117828-27085-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 1.7.7.2 Cc: Paul Gortmaker , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org The legacy_serial code was setting things up based on the assumption that the main 8250 driver would be loaded shortly after. But some randconfigs exposed an issue where early debug (UDB) UART support was enabled, yet the core UART 8250 support was disabled. In theory a person could care about _really_ early UART output for early debug, but not care about generic console output via UART on embedded devices, so fix things so it is a valid combination. While this might seem like a pointless randconfig change, there are some existing default configs that actually reflect the above setup. Signed-off-by: Paul Gortmaker diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 3fea368..9a82a49 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c @@ -413,6 +413,14 @@ void __init find_legacy_serial_ports(void) DBG(" <- find_legacy_serial_port()\n"); } +/* + * In theory, one could have the early debugging enabled, but yet not care + * about 8250 after that, i.e. PPC_UDBG_16550=y but "SERIAL_8250 is not set". + * Mostly appears in randconfig builds, but some defconfigs have this. + */ + +#ifdef CONFIG_SERIAL_8250 + static struct platform_device serial_device = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, @@ -523,6 +531,7 @@ static int __init serial_dev_init(void) } device_initcall(serial_dev_init); +#endif /* CONFIG_SERIAL_8250 */ #ifdef CONFIG_SERIAL_8250_CONSOLE /*