diff options
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 4b47e59248df..c4c5a29a7bed 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -931,8 +931,16 @@ void register_console(struct console *console) | |||
931 | { | 931 | { |
932 | int i; | 932 | int i; |
933 | unsigned long flags; | 933 | unsigned long flags; |
934 | struct console *bootconsole = NULL; | ||
934 | 935 | ||
935 | if (preferred_console < 0) | 936 | if (console_drivers) { |
937 | if (console->flags & CON_BOOT) | ||
938 | return; | ||
939 | if (console_drivers->flags & CON_BOOT) | ||
940 | bootconsole = console_drivers; | ||
941 | } | ||
942 | |||
943 | if (preferred_console < 0 || bootconsole || !console_drivers) | ||
936 | preferred_console = selected_console; | 944 | preferred_console = selected_console; |
937 | 945 | ||
938 | /* | 946 | /* |
@@ -978,8 +986,11 @@ void register_console(struct console *console) | |||
978 | if (!(console->flags & CON_ENABLED)) | 986 | if (!(console->flags & CON_ENABLED)) |
979 | return; | 987 | return; |
980 | 988 | ||
981 | if (console_drivers && (console_drivers->flags & CON_BOOT)) { | 989 | if (bootconsole) { |
982 | unregister_console(console_drivers); | 990 | printk(KERN_INFO "console handover: boot [%s%d] -> real [%s%d]\n", |
991 | bootconsole->name, bootconsole->index, | ||
992 | console->name, console->index); | ||
993 | unregister_console(bootconsole); | ||
983 | console->flags &= ~CON_PRINTBUFFER; | 994 | console->flags &= ~CON_PRINTBUFFER; |
984 | } | 995 | } |
985 | 996 | ||
@@ -1030,16 +1041,11 @@ int unregister_console(struct console *console) | |||
1030 | } | 1041 | } |
1031 | } | 1042 | } |
1032 | 1043 | ||
1033 | /* If last console is removed, we re-enable picking the first | 1044 | /* |
1034 | * one that gets registered. Without that, pmac early boot console | ||
1035 | * would prevent fbcon from taking over. | ||
1036 | * | ||
1037 | * If this isn't the last console and it has CON_CONSDEV set, we | 1045 | * If this isn't the last console and it has CON_CONSDEV set, we |
1038 | * need to set it on the next preferred console. | 1046 | * need to set it on the next preferred console. |
1039 | */ | 1047 | */ |
1040 | if (console_drivers == NULL) | 1048 | if (console_drivers != NULL && console->flags & CON_CONSDEV) |
1041 | preferred_console = selected_console; | ||
1042 | else if (console->flags & CON_CONSDEV) | ||
1043 | console_drivers->flags |= CON_CONSDEV; | 1049 | console_drivers->flags |= CON_CONSDEV; |
1044 | 1050 | ||
1045 | release_console_sem(); | 1051 | release_console_sem(); |