of: earlycon: Fixup earlycon console name and index
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 16 Jan 2016 23:23:41 +0000 (15:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 06:07:37 +0000 (22:07 -0800)
Use the console name embedded in the OF earlycon table by the
OF_EARLYCON_DECLARE() macro to initialize the struct console 'name'
and 'index' fields.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/fdt.c
drivers/tty/serial/earlycon.c
include/linux/serial_core.h

index 1686118676117093bced5fd429da3b6c7af2a7d3..ec1459517de6b32bcc7dabb7346d1b1b1f65947e 100644 (file)
@@ -838,7 +838,7 @@ static int __init early_init_dt_scan_chosen_serial(void)
                if (addr == OF_BAD_ADDR)
                        return -ENXIO;
 
-               of_setup_earlycon(addr, match->setup);
+               of_setup_earlycon(addr, match);
                return 0;
        }
        return -ENODEV;
index 90b064faa1c4556ff3d0b2f0480800b02f929efc..47e54deb944b8a7f0420b828779d92daa65404ed 100644 (file)
@@ -218,7 +218,7 @@ early_param("earlycon", param_setup_earlycon);
 #ifdef CONFIG_OF_EARLY_FLATTREE
 
 int __init of_setup_earlycon(unsigned long addr,
-                            int (*setup)(struct earlycon_device *, const char *))
+                            const struct earlycon_id *match)
 {
        int err;
        struct uart_port *port = &early_console_dev.port;
@@ -229,8 +229,8 @@ int __init of_setup_earlycon(unsigned long addr,
        port->uartclk = BASE_BAUD * 16;
        port->membase = earlycon_map(addr, SZ_4K);
 
-       early_console_dev.con->data = &early_console_dev;
-       err = setup(&early_console_dev, NULL);
+       earlycon_init(&early_console_dev, match->name);
+       err = match->setup(&early_console_dev, NULL);
        if (err < 0)
                return err;
        if (!early_console_dev.con->write)
index 25e05147f3795e373d8ef18ec9b949bed3519898..63fdb55e4c9da8c076aa99e24c63d4a2c4cb7ea1 100644 (file)
@@ -359,8 +359,7 @@ extern const struct earlycon_id __earlycon_table_end[];
 #define EARLYCON_DECLARE(_name, fn)    OF_EARLYCON_DECLARE(_name, "", fn)
 
 extern int setup_earlycon(char *buf);
-extern int of_setup_earlycon(unsigned long addr,
-                            int (*setup)(struct earlycon_device *, const char *));
+extern int of_setup_earlycon(unsigned long addr, const struct earlycon_id *match);
 
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
                                   struct console *c);