aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-16 18:23:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 01:07:37 -0500
commit05d961320ba624c98b16d72b32f947307674b341 (patch)
treef67a57f0a7d8152957461434cf9c4169f48374f4
parentcda64e68240265752c6db22a75f28707dfaf6563 (diff)
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: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/of/fdt.c2
-rw-r--r--drivers/tty/serial/earlycon.c6
-rw-r--r--include/linux/serial_core.h3
3 files changed, 5 insertions, 6 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 168611867611..ec1459517de6 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -838,7 +838,7 @@ static int __init early_init_dt_scan_chosen_serial(void)
838 if (addr == OF_BAD_ADDR) 838 if (addr == OF_BAD_ADDR)
839 return -ENXIO; 839 return -ENXIO;
840 840
841 of_setup_earlycon(addr, match->setup); 841 of_setup_earlycon(addr, match);
842 return 0; 842 return 0;
843 } 843 }
844 return -ENODEV; 844 return -ENODEV;
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 90b064faa1c4..47e54deb944b 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -218,7 +218,7 @@ early_param("earlycon", param_setup_earlycon);
218#ifdef CONFIG_OF_EARLY_FLATTREE 218#ifdef CONFIG_OF_EARLY_FLATTREE
219 219
220int __init of_setup_earlycon(unsigned long addr, 220int __init of_setup_earlycon(unsigned long addr,
221 int (*setup)(struct earlycon_device *, const char *)) 221 const struct earlycon_id *match)
222{ 222{
223 int err; 223 int err;
224 struct uart_port *port = &early_console_dev.port; 224 struct uart_port *port = &early_console_dev.port;
@@ -229,8 +229,8 @@ int __init of_setup_earlycon(unsigned long addr,
229 port->uartclk = BASE_BAUD * 16; 229 port->uartclk = BASE_BAUD * 16;
230 port->membase = earlycon_map(addr, SZ_4K); 230 port->membase = earlycon_map(addr, SZ_4K);
231 231
232 early_console_dev.con->data = &early_console_dev; 232 earlycon_init(&early_console_dev, match->name);
233 err = setup(&early_console_dev, NULL); 233 err = match->setup(&early_console_dev, NULL);
234 if (err < 0) 234 if (err < 0)
235 return err; 235 return err;
236 if (!early_console_dev.con->write) 236 if (!early_console_dev.con->write)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 25e05147f379..63fdb55e4c9d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -359,8 +359,7 @@ extern const struct earlycon_id __earlycon_table_end[];
359#define EARLYCON_DECLARE(_name, fn) OF_EARLYCON_DECLARE(_name, "", fn) 359#define EARLYCON_DECLARE(_name, fn) OF_EARLYCON_DECLARE(_name, "", fn)
360 360
361extern int setup_earlycon(char *buf); 361extern int setup_earlycon(char *buf);
362extern int of_setup_earlycon(unsigned long addr, 362extern int of_setup_earlycon(unsigned long addr, const struct earlycon_id *match);
363 int (*setup)(struct earlycon_device *, const char *));
364 363
365struct uart_port *uart_get_console(struct uart_port *ports, int nr, 364struct uart_port *uart_get_console(struct uart_port *ports, int nr,
366 struct console *c); 365 struct console *c);