diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2016-01-16 18:23:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 01:07:37 -0500 |
commit | 4d118c9a866590850dad8689262a95345d2c6e09 (patch) | |
tree | a5667d9441ff995380c4fc1bbda65e1d7bf5f1e7 /drivers/of | |
parent | 05d961320ba624c98b16d72b32f947307674b341 (diff) |
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 <robh@kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/fdt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index ec1459517de6..cfd3b35e8d81 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) | |||
800 | static int __init early_init_dt_scan_chosen_serial(void) | 800 | static int __init early_init_dt_scan_chosen_serial(void) |
801 | { | 801 | { |
802 | int offset; | 802 | int offset; |
803 | const char *p; | 803 | const char *p, *q, *options = NULL; |
804 | int l; | 804 | int l; |
805 | const struct earlycon_id *match; | 805 | const struct earlycon_id *match; |
806 | const void *fdt = initial_boot_params; | 806 | const void *fdt = initial_boot_params; |
@@ -817,11 +817,12 @@ static int __init early_init_dt_scan_chosen_serial(void) | |||
817 | if (!p || !l) | 817 | if (!p || !l) |
818 | return -ENOENT; | 818 | return -ENOENT; |
819 | 819 | ||
820 | /* Remove console options if present */ | 820 | q = strchrnul(p, ':'); |
821 | l = strchrnul(p, ':') - p; | 821 | if (*q != '\0') |
822 | options = q + 1; | ||
822 | 823 | ||
823 | /* Get the node specified by stdout-path */ | 824 | /* Get the node specified by stdout-path */ |
824 | offset = fdt_path_offset_namelen(fdt, p, l); | 825 | offset = fdt_path_offset_namelen(fdt, p, q - p); |
825 | if (offset < 0) | 826 | if (offset < 0) |
826 | return -ENODEV; | 827 | return -ENODEV; |
827 | 828 | ||
@@ -838,7 +839,7 @@ static int __init early_init_dt_scan_chosen_serial(void) | |||
838 | if (addr == OF_BAD_ADDR) | 839 | if (addr == OF_BAD_ADDR) |
839 | return -ENXIO; | 840 | return -ENXIO; |
840 | 841 | ||
841 | of_setup_earlycon(addr, match); | 842 | of_setup_earlycon(addr, match, options); |
842 | return 0; | 843 | return 0; |
843 | } | 844 | } |
844 | return -ENODEV; | 845 | return -ENODEV; |