linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Russell King <linux@arm.linux.org.uk>,
	Will Deacon <will.deacon@arm.com>, Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 3/7] tty/serial: convert 8250 to generic earlycon
Date: Mon, 28 Apr 2014 18:20:53 -0500	[thread overview]
Message-ID: <CAL_JsqKux+BTHeYo6XEzzQMAFJZHVjbURM973oHT=t698GbJbA@mail.gmail.com> (raw)
In-Reply-To: <CAE9FiQVrwypK4u5yTCt-AxMuBnOn7jv=V3d4Zb3cd9JDNEUVPw@mail.gmail.com>

On Sat, Apr 26, 2014 at 1:19 AM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Fri, Apr 18, 2014 at 3:19 PM, Rob Herring <robherring2@gmail.com> wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> With the generic earlycon infrastructure in place, convert the 8250
>> early console to use it.
>>
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Jiri Slaby <jslaby@suse.cz>
>> ---
>>  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);

  reply	other threads:[~2014-04-28 23:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18 22:19 [PATCH v2 0/7] Generic serial earlycon Rob Herring
2014-04-18 22:19 ` [PATCH v2 1/7] x86: move FIX_EARLYCON_MEM kconfig into x86 Rob Herring
2014-04-18 22:19 ` [PATCH v2 2/7] tty/serial: add generic serial earlycon Rob Herring
2014-04-18 22:19 ` [PATCH v2 3/7] tty/serial: convert 8250 to generic earlycon Rob Herring
2014-04-26  6:19   ` Yinghai Lu
2014-04-28 23:20     ` Rob Herring [this message]
2014-05-03 22:07       ` Greg Kroah-Hartman
2014-05-03 22:16         ` Greg Kroah-Hartman
2014-06-09 22:25           ` Tony Luck
2014-06-09 22:35             ` Tony Luck
2014-06-09 23:18               ` Rob Herring
2014-06-10 20:52                 ` Tony Luck
2014-06-10 22:38                   ` Rob Herring
2014-06-11 17:58                   ` Rob Herring
2014-06-11 22:20                     ` Tony Luck
2014-06-11 23:44                     ` Yinghai Lu
2014-06-09 22:36             ` Rob Herring
2014-04-26  6:29   ` Yinghai Lu
2014-04-28 23:24     ` Rob Herring
2014-04-29  2:56       ` Yinghai Lu
2014-04-29 15:16         ` Rob Herring
2014-04-29 18:22           ` Yinghai Lu
2014-04-29 20:41             ` Rob Herring
2014-04-29 22:00               ` Yinghai Lu
2014-04-18 22:19 ` [PATCH v2 4/7] tty/serial: pl011: add generic earlycon support Rob Herring
2014-04-18 22:19 ` [PATCH v2 5/7] tty/serial: add arm/arm64 semihosting earlycon Rob Herring
2014-04-18 22:19 ` [PATCH v2 6/7] arm64: enable FIX_EARLYCON_MEM kconfig Rob Herring
2014-04-18 22:20 ` [PATCH v2 7/7] arm64: remove arch specific earlyprintk Rob Herring
2014-04-29 11:09 ` [PATCH v2 0/7] Generic serial earlycon Catalin Marinas
2014-04-29 15:12   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL_JsqKux+BTHeYo6XEzzQMAFJZHVjbURM973oHT=t698GbJbA@mail.gmail.com' \
    --to=robherring2@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=will.deacon@arm.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).