X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fserial%2Fsuncore.c;h=6381a0282ee79ab3f43e464f19a48a0880faa4bc;hb=1ce1e41c1b61a992077bd1c45c6c3fd6a8b10c02;hp=544f2e25d0e545f30f959019f4a176bdccb20af8;hpb=44d51a029f95d49c5c7ccd7808f81904c20c3abd;p=karo-tx-linux.git 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); int sunserial_console_match(struct console *con, struct device_node *dp, struct uart_driver *drv, int line, bool ignore_line) { - if (!con || of_console_device != dp) + if (!con) + return 0; + + drv->cons = con; + + if (of_console_device != dp) return 0; if (!ignore_line) { @@ -69,12 +74,10 @@ int sunserial_console_match(struct console *con, struct device_node *dp, return 0; } - con->index = line; - drv->cons = con; - - if (!console_set_on_cmdline) + if (!console_set_on_cmdline) { + con->index = line; add_preferred_console(con->name, line, NULL); - + } return 1; } EXPORT_SYMBOL(sunserial_console_match);