From patchwork Mon Apr 28 23:20:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 4083131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C54B79F271 for ; Mon, 28 Apr 2014 23:24:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E666F201F9 for ; Mon, 28 Apr 2014 23:24:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1399C201D3 for ; Mon, 28 Apr 2014 23:24:35 +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 1WeurQ-0005Sz-G3; Mon, 28 Apr 2014 23:21:20 +0000 Received: from mail-vc0-x234.google.com ([2607:f8b0:400c:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WeurN-0005KJ-7j for linux-arm-kernel@lists.infradead.org; Mon, 28 Apr 2014 23:21:17 +0000 Received: by mail-vc0-f180.google.com with SMTP id hq16so6463384vcb.39 for ; Mon, 28 Apr 2014 16:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3SjnqezSnuzx/1yntqr9AHInQE+r7H8DHNSvmzojJlY=; b=Pa7SBY8KDsXw6OlqNkZnvb3ry4wcBNk14nm4GsHfk70yooyPYhlAEzdVsJe9RSKbwG e36TEkopwq2QDQwhV6HNTphGQPFIoa3qytQBX8pvQwV8Dw79Ik/yrnWwEpXESGaAr8B6 868WVbZoQOz7evksIfJfDyX/r62ssKd6tyqHj9rUbeGtLHBajTaDT62jODsTVTWx0G6s R6koIk8bw75dAhH4oJX2SWiiqjKFsT6KsZh8BrwCaYWp/UwbsGxpxrnWqktxQKk7X4Uj LNhzCdIoOyg5qYfmRpKGTeFrRcRsGuZuxtSJHMbwtpOFIHZ+E5BBeeoS+xvPbGe7M3WS h1aA== MIME-Version: 1.0 X-Received: by 10.52.142.10 with SMTP id rs10mr22495345vdb.3.1398727254183; Mon, 28 Apr 2014 16:20:54 -0700 (PDT) Received: by 10.220.50.132 with HTTP; Mon, 28 Apr 2014 16:20:53 -0700 (PDT) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140428_162117_353021_CBBC340E X-CRM114-Status: GOOD ( 17.88 ) X-Spam-Score: 0.1 (/) Cc: Russell King , Arnd Bergmann , Catalin Marinas , Will Deacon , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , Greg Kroah-Hartman , Andrew Morton , Jiri Slaby , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 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: 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); 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;