serial: sirf: assign console default index if users not set a valid one

it seems this is a more typical behaviour from reviewing other console
drivers.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Qipan Li 2015-05-14 06:45:26 +00:00 committed by Greg Kroah-Hartman
parent 7f60f2fe16
commit c35b49b716

View File

@ -1236,7 +1236,7 @@ sirfsoc_uart_console_setup(struct console *co, char *options)
struct sirfsoc_uart_port *sirfport;
struct sirfsoc_register *ureg;
if (co->index < 0 || co->index >= SIRFSOC_UART_NR)
return -EINVAL;
co->index = 1;
sirfport = sirf_ports[co->index];
if (!sirfport)
return -ENODEV;