Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933713AbbEOK17 (ORCPT ); Fri, 15 May 2015 06:27:59 -0400 Received: from 251.110.2.81.in-addr.arpa ([81.2.110.251]:55448 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752458AbbEOK15 (ORCPT ); Fri, 15 May 2015 06:27:57 -0400 Date: Fri, 15 May 2015 11:27:40 +0100 From: One Thousand Gnomes To: Bin Gao Cc: Greg Kroah-Hartman , Peter Hurley , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] serial_core: add pci uart early console support Message-ID: <20150515112740.3f9d8c28@lxorguk.ukuu.org.uk> In-Reply-To: <20150515043435.GB100883@worksta> References: <20150515043435.GB100883@worksta> Organization: Intel Corporation X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1915 Lines: 71 > +/* x86 uses "earlyprintk=xxx", so we keep the compatibility here */ > +#ifdef CONFIG_X86 > +early_param("earlyprintk", param_setup_earlycon); > +#else > early_param("earlycon", param_setup_earlycon); > +#endif Is there any reason for not just allowing both ? That way you don't need an ifdef and the same command line (either) works everywhere ? > > int __init of_setup_earlycon(unsigned long addr, > int (*setup)(struct earlycon_device *, const char *)) > diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c > index 0b7bb12..221143c 100644 > --- a/drivers/tty/serial/serial_core.c > +++ b/drivers/tty/serial/serial_core.c > @@ -34,10 +34,16 @@ > #include > #include > #include > +#include > > #include > #include > > +/* Only x86 has early pci access APIs */ > +#if defined(CONFIG_PCI) && defined(CONFIG_X86) > +#include > +#endif We should probably make that a define or Kconfig value so that any other port wanting early PCI console can add the needed direct functions without the defines here getting longer and longer It would then be a single #if defined(CONFIG_EARLY_PCI) that could be put anywhere > +static int parse_pci_options(char *options, unsigned long *phys) > +{ > + u8 bus, dev, func; ... > +failed: > + pr_err("Invalid earlycon pci parameters\n"); > + return -EINVAL; > +} #else static int parse_pci_options(char *options, unsigned long *phys) { pr_err("earlycon pci not available\n"); return -EINVAL; } > +#endif > + The all the ifdef mess below goes away Alan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/