From 4d118c9a866590850dad8689262a95345d2c6e09 Mon Sep 17 00:00:00 2001 From: Peter Hurley Date: Sat, 16 Jan 2016 15:23:42 -0800 Subject: of: earlycon: Add options string handling Pass-through any options string in the 'stdout-path' property to the earlycon "driver" setup. Acked-by: Rob Herring Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- drivers/of/fdt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/of') diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index ec14595..cfd3b35 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -800,7 +800,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node) static int __init early_init_dt_scan_chosen_serial(void) { int offset; - const char *p; + const char *p, *q, *options = NULL; int l; const struct earlycon_id *match; const void *fdt = initial_boot_params; @@ -817,11 +817,12 @@ static int __init early_init_dt_scan_chosen_serial(void) if (!p || !l) return -ENOENT; - /* Remove console options if present */ - l = strchrnul(p, ':') - p; + q = strchrnul(p, ':'); + if (*q != '\0') + options = q + 1; /* Get the node specified by stdout-path */ - offset = fdt_path_offset_namelen(fdt, p, l); + offset = fdt_path_offset_namelen(fdt, p, q - p); if (offset < 0) return -ENODEV; @@ -838,7 +839,7 @@ static int __init early_init_dt_scan_chosen_serial(void) if (addr == OF_BAD_ADDR) return -ENXIO; - of_setup_earlycon(addr, match); + of_setup_earlycon(addr, match, options); return 0; } return -ENODEV; -- cgit v1.1