Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753450AbaD1XU5 (ORCPT ); Mon, 28 Apr 2014 19:20:57 -0400 Received: from mail-vc0-f172.google.com ([209.85.220.172]:39940 "EHLO mail-vc0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbaD1XUy (ORCPT ); Mon, 28 Apr 2014 19:20:54 -0400 MIME-Version: 1.0 In-Reply-To: References: <1397859600-11507-1-git-send-email-robherring2@gmail.com> <1397859600-11507-4-git-send-email-robherring2@gmail.com> Date: Mon, 28 Apr 2014 18:20:53 -0500 Message-ID: Subject: Re: [PATCH v2 3/7] tty/serial: convert 8250 to generic earlycon From: Rob Herring To: Yinghai Lu Cc: "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , Greg Kroah-Hartman , Jiri Slaby , Catalin Marinas , Russell King , Will Deacon , Arnd Bergmann , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 26, 2014 at 1:19 AM, Yinghai Lu wrote: > On Fri, Apr 18, 2014 at 3:19 PM, Rob Herring wrote: >> From: Rob Herring >> >> With the generic earlycon infrastructure in place, convert the 8250 >> early console to use it. >> >> Signed-off-by: Rob Herring >> Cc: Greg Kroah-Hartman >> Cc: Jiri Slaby >> --- >> drivers/tty/serial/8250/8250_early.c | 138 ++++------------------------------- >> drivers/tty/serial/8250/Kconfig | 1 + >> 2 files changed, 16 insertions(+), 123 deletions(-) > > Hi Greg, Rob > > This one in tty-next breaks booting: "console=uart8250,io,0x3f8,115200". > No early console and regular console anymore. > > It should produce "early con and regular con". This is what I get for running checkpatch and converting simple_strtoul to kstrto* which are not so equivalent. kstrto* will not convert things such as 115200n8 to a number. Greg, Do you want a fix or for me to respin the series? The fix looks like this: diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 73bf1e2..c92e830 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -53,7 +53,7 @@ static int __init parse_options(struct earlycon_device *device, char *options) { struct uart_port *port = &device->port; - int mmio, mmio32, length, ret; + int mmio, mmio32, length; unsigned long addr; if (!options) @@ -64,25 +64,19 @@ static int __init parse_options(struct earlycon_device *device, if (mmio || mmio32) { port->iotype = (mmio ? UPIO_MEM : UPIO_MEM32); options += mmio ? 5 : 7; - ret = kstrtoul(options, 0, &addr); - if (ret) - return ret; + addr = simple_strtoul(options, NULL, 0); port->mapbase = addr; if (mmio32) port->regshift = 2; } else if (!strncmp(options, "io,", 3)) { port->iotype = UPIO_PORT; options += 3; - ret = kstrtoul(options, 0, &addr); - if (ret) - return ret; + addr = simple_strtoul(options, NULL, 0); port->iobase = addr; mmio = 0; } else if (!strncmp(options, "0x", 2)) { port->iotype = UPIO_MEM; - ret = kstrtoul(options, 0, &addr); - if (ret) - return ret; + addr = simple_strtoul(options, NULL, 0); port->mapbase = addr; } else { return -EINVAL; @@ -93,9 +87,7 @@ static int __init parse_options(struct earlycon_device *device, options = strchr(options, ','); if (options) { options++; - ret = kstrtouint(options, 0, &device->baud); - if (ret) - return ret; + device->baud = simple_strtoul(options, NULL, 0); length = min(strcspn(options, " ") + 1, (size_t)(sizeof(device->options))); strlcpy(device->options, options, length); -- 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/