aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/suncore.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index 544f2e25d0e5..6381a0282ee7 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -55,7 +55,12 @@ EXPORT_SYMBOL(sunserial_unregister_minors);
55int sunserial_console_match(struct console *con, struct device_node *dp, 55int sunserial_console_match(struct console *con, struct device_node *dp,
56 struct uart_driver *drv, int line, bool ignore_line) 56 struct uart_driver *drv, int line, bool ignore_line)
57{ 57{
58 if (!con || of_console_device != dp) 58 if (!con)
59 return 0;
60
61 drv->cons = con;
62
63 if (of_console_device != dp)
59 return 0; 64 return 0;
60 65
61 if (!ignore_line) { 66 if (!ignore_line) {
@@ -69,12 +74,10 @@ int sunserial_console_match(struct console *con, struct device_node *dp,
69 return 0; 74 return 0;
70 } 75 }
71 76
72 con->index = line; 77 if (!console_set_on_cmdline) {
73 drv->cons = con; 78 con->index = line;
74
75 if (!console_set_on_cmdline)
76 add_preferred_console(con->name, line, NULL); 79 add_preferred_console(con->name, line, NULL);
77 80 }
78 return 1; 81 return 1;
79} 82}
80EXPORT_SYMBOL(sunserial_console_match); 83EXPORT_SYMBOL(sunserial_console_match);