diff options
-rw-r--r-- | kernel/printk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 01b58d7d17ff..3a442bfb8bee 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -876,8 +876,10 @@ void register_console(struct console * console) | |||
876 | break; | 876 | break; |
877 | console->flags |= CON_ENABLED; | 877 | console->flags |= CON_ENABLED; |
878 | console->index = console_cmdline[i].index; | 878 | console->index = console_cmdline[i].index; |
879 | if (i == preferred_console) | 879 | if (i == selected_console) { |
880 | console->flags |= CON_CONSDEV; | 880 | console->flags |= CON_CONSDEV; |
881 | preferred_console = selected_console; | ||
882 | } | ||
881 | break; | 883 | break; |
882 | } | 884 | } |
883 | 885 | ||
@@ -897,6 +899,8 @@ void register_console(struct console * console) | |||
897 | if ((console->flags & CON_CONSDEV) || console_drivers == NULL) { | 899 | if ((console->flags & CON_CONSDEV) || console_drivers == NULL) { |
898 | console->next = console_drivers; | 900 | console->next = console_drivers; |
899 | console_drivers = console; | 901 | console_drivers = console; |
902 | if (console->next) | ||
903 | console->next->flags &= ~CON_CONSDEV; | ||
900 | } else { | 904 | } else { |
901 | console->next = console_drivers->next; | 905 | console->next = console_drivers->next; |
902 | console_drivers->next = console; | 906 | console_drivers->next = console; |
@@ -937,10 +941,14 @@ int unregister_console(struct console * console) | |||
937 | /* If last console is removed, we re-enable picking the first | 941 | /* If last console is removed, we re-enable picking the first |
938 | * one that gets registered. Without that, pmac early boot console | 942 | * one that gets registered. Without that, pmac early boot console |
939 | * would prevent fbcon from taking over. | 943 | * would prevent fbcon from taking over. |
944 | * | ||
945 | * If this isn't the last console and it has CON_CONSDEV set, we | ||
946 | * need to set it on the next preferred console. | ||
940 | */ | 947 | */ |
941 | if (console_drivers == NULL) | 948 | if (console_drivers == NULL) |
942 | preferred_console = selected_console; | 949 | preferred_console = selected_console; |
943 | 950 | else if (console->flags & CON_CONSDEV) | |
951 | console_drivers->flags |= CON_CONSDEV; | ||
944 | 952 | ||
945 | release_console_sem(); | 953 | release_console_sem(); |
946 | return res; | 954 | return res; |