lkml.org 
[lkml]   [2014]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH v2 3/7] tty/serial: convert 8250 to generic earlycon
From
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);

\
 
 \ /
  Last update: 2014-04-29 02:01    [W:0.121 / U:1.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site