Commit 05d96132 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

of: earlycon: Fixup earlycon console name and index

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: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cda64e68
...@@ -838,7 +838,7 @@ static int __init early_init_dt_scan_chosen_serial(void) ...@@ -838,7 +838,7 @@ static int __init early_init_dt_scan_chosen_serial(void)
if (addr == OF_BAD_ADDR) if (addr == OF_BAD_ADDR)
return -ENXIO; return -ENXIO;
of_setup_earlycon(addr, match->setup); of_setup_earlycon(addr, match);
return 0; return 0;
} }
return -ENODEV; return -ENODEV;
......
...@@ -218,7 +218,7 @@ early_param("earlycon", param_setup_earlycon); ...@@ -218,7 +218,7 @@ early_param("earlycon", param_setup_earlycon);
#ifdef CONFIG_OF_EARLY_FLATTREE #ifdef CONFIG_OF_EARLY_FLATTREE
int __init of_setup_earlycon(unsigned long addr, int __init of_setup_earlycon(unsigned long addr,
int (*setup)(struct earlycon_device *, const char *)) const struct earlycon_id *match)
{ {
int err; int err;
struct uart_port *port = &early_console_dev.port; struct uart_port *port = &early_console_dev.port;
...@@ -229,8 +229,8 @@ int __init of_setup_earlycon(unsigned long addr, ...@@ -229,8 +229,8 @@ int __init of_setup_earlycon(unsigned long addr,
port->uartclk = BASE_BAUD * 16; port->uartclk = BASE_BAUD * 16;
port->membase = earlycon_map(addr, SZ_4K); port->membase = earlycon_map(addr, SZ_4K);
early_console_dev.con->data = &early_console_dev; earlycon_init(&early_console_dev, match->name);
err = setup(&early_console_dev, NULL); err = match->setup(&early_console_dev, NULL);
if (err < 0) if (err < 0)
return err; return err;
if (!early_console_dev.con->write) if (!early_console_dev.con->write)
......
...@@ -359,8 +359,7 @@ extern const struct earlycon_id __earlycon_table_end[]; ...@@ -359,8 +359,7 @@ extern const struct earlycon_id __earlycon_table_end[];
#define EARLYCON_DECLARE(_name, fn) OF_EARLYCON_DECLARE(_name, "", fn) #define EARLYCON_DECLARE(_name, fn) OF_EARLYCON_DECLARE(_name, "", fn)
extern int setup_earlycon(char *buf); extern int setup_earlycon(char *buf);
extern int of_setup_earlycon(unsigned long addr, extern int of_setup_earlycon(unsigned long addr, const struct earlycon_id *match);
int (*setup)(struct earlycon_device *, const char *));
struct uart_port *uart_get_console(struct uart_port *ports, int nr, struct uart_port *uart_get_console(struct uart_port *ports, int nr,
struct console *c); struct console *c);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment