diff options
author | Leif Lindholm <leif.lindholm@linaro.org> | 2016-09-27 16:54:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-28 11:43:15 -0400 |
commit | d503187b6cc4e41c21c02e695e0e7b5acdd066de (patch) | |
tree | 2d4df7a30f4d7168044bef7e3bb77c6a8cb788e2 | |
parent | 094a32626f904f92beda174154daca3fe4455890 (diff) |
of/serial: move earlycon early_param handling to serial
We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one. It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.
Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/of/fdt.c | 11 | ||||
-rw-r--r-- | drivers/tty/serial/earlycon.c | 2 | ||||
-rw-r--r-- | include/linux/of_fdt.h | 3 |
3 files changed, 5 insertions, 11 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 085c6389afd1..c89d5d231a0e 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node) | |||
924 | 924 | ||
925 | #ifdef CONFIG_SERIAL_EARLYCON | 925 | #ifdef CONFIG_SERIAL_EARLYCON |
926 | 926 | ||
927 | static int __init early_init_dt_scan_chosen_serial(void) | 927 | int __init early_init_dt_scan_chosen_stdout(void) |
928 | { | 928 | { |
929 | int offset; | 929 | int offset; |
930 | const char *p, *q, *options = NULL; | 930 | const char *p, *q, *options = NULL; |
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void) | |||
968 | } | 968 | } |
969 | return -ENODEV; | 969 | return -ENODEV; |
970 | } | 970 | } |
971 | |||
972 | static int __init setup_of_earlycon(char *buf) | ||
973 | { | ||
974 | if (buf) | ||
975 | return 0; | ||
976 | |||
977 | return early_init_dt_scan_chosen_serial(); | ||
978 | } | ||
979 | early_param("earlycon", setup_of_earlycon); | ||
980 | #endif | 971 | #endif |
981 | 972 | ||
982 | /** | 973 | /** |
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 3940280afa9c..836cad222fcc 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c | |||
@@ -208,7 +208,7 @@ static int __init param_setup_earlycon(char *buf) | |||
208 | * don't generate a warning from parse_early_params() in that case | 208 | * don't generate a warning from parse_early_params() in that case |
209 | */ | 209 | */ |
210 | if (!buf || !buf[0]) | 210 | if (!buf || !buf[0]) |
211 | return 0; | 211 | return early_init_dt_scan_chosen_stdout(); |
212 | 212 | ||
213 | err = setup_earlycon(buf); | 213 | err = setup_earlycon(buf); |
214 | if (err == -ENOENT || err == -EALREADY) | 214 | if (err == -ENOENT || err == -EALREADY) |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 26c3302ae58f..4341f32516d8 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/errno.h> | ||
17 | 18 | ||
18 | /* Definitions used by the flattened device tree */ | 19 | /* Definitions used by the flattened device tree */ |
19 | #define OF_DT_HEADER 0xd00dfeed /* marker */ | 20 | #define OF_DT_HEADER 0xd00dfeed /* marker */ |
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
66 | int depth, void *data); | 67 | int depth, void *data); |
67 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | 68 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, |
68 | int depth, void *data); | 69 | int depth, void *data); |
70 | extern int early_init_dt_scan_chosen_stdout(void); | ||
69 | extern void early_init_fdt_scan_reserved_mem(void); | 71 | extern void early_init_fdt_scan_reserved_mem(void); |
70 | extern void early_init_fdt_reserve_self(void); | 72 | extern void early_init_fdt_reserve_self(void); |
71 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | 73 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); |
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *); | |||
94 | extern u64 of_flat_dt_translate_address(unsigned long node); | 96 | extern u64 of_flat_dt_translate_address(unsigned long node); |
95 | extern void of_fdt_limit_memory(int limit); | 97 | extern void of_fdt_limit_memory(int limit); |
96 | #else /* CONFIG_OF_FLATTREE */ | 98 | #else /* CONFIG_OF_FLATTREE */ |
99 | static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; } | ||
97 | static inline void early_init_fdt_scan_reserved_mem(void) {} | 100 | static inline void early_init_fdt_scan_reserved_mem(void) {} |
98 | static inline void early_init_fdt_reserve_self(void) {} | 101 | static inline void early_init_fdt_reserve_self(void) {} |
99 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } | 102 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } |