diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2017-04-12 18:37:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-18 18:01:52 +0200 |
commit | 0c688614dcce84dfdbb305fd1c399c06cecea745 (patch) | |
tree | 5d96d52fe1b750645adb8c9b433bb98e6c801015 /kernel/printk | |
parent | 72f1b85a045e3db4d21e9531bdc605157fa224a7 (diff) | |
download | linux-0c688614dcce84dfdbb305fd1c399c06cecea745.tar.gz linux-0c688614dcce84dfdbb305fd1c399c06cecea745.tar.bz2 linux-0c688614dcce84dfdbb305fd1c399c06cecea745.zip |
console: move console_init() out of tty_io.c
All the console driver handling code lives in printk.c.
Move console_init() there as well so console support can still be used
when the TTY code is configured out. No logical changes from this patch.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/printk')
-rw-r--r-- | kernel/printk/printk.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 2984fb0f0257..3a0940652660 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2611,6 +2611,30 @@ int unregister_console(struct console *console) EXPORT_SYMBOL(unregister_console); /* + * Initialize the console device. This is called *early*, so + * we can't necessarily depend on lots of kernel help here. + * Just do some early initializations, and do the complex setup + * later. + */ +void __init console_init(void) +{ + initcall_t *call; + + /* Setup the default TTY line discipline. */ + n_tty_init(); + + /* + * set up the console device so that later boot sequences can + * inform about problems etc.. + */ + call = __con_initcall_start; + while (call < __con_initcall_end) { + (*call)(); + call++; + } +} + +/* * Some boot consoles access data that is in the init section and which will * be discarded after the initcalls have been run. To make sure that no code * will access this data, unregister the boot consoles in a late initcall. |