serial: sirf: assign console default index if users not set a valid one
authorQipan Li <Qipan.Li@csr.com>
Thu, 14 May 2015 06:45:26 +0000 (06:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 19:50:41 +0000 (12:50 -0700)
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>
drivers/tty/serial/sirfsoc_uart.c

index 0e43799397039310c53e85a448734bca084046ae..8d759629ffb0238bbfd455b4ccc8235787623cc5 100644 (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;