]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
serial: xuartps: Fix check in console_setup().
authorThomas Betker <thomas.betker@rohde-schwarz.com>
Wed, 11 Mar 2015 21:39:28 +0000 (22:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 21:55:18 +0000 (22:55 +0100)
cdns_uart_console_setup() checks port->mapbase != 0, but the port may
not be initialized yet even if this condition is met [e.g., ioremap()
may have failed]. Check port->membase != NULL instead, similar to
cdns_early_console_setup().

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/xilinx_uartps.c

index 556062a438cf99990215362e1b1994c34b751685..f218ec658f5d200e415d6bdf7503f7bc83f7a825 100644 (file)
@@ -1155,7 +1155,7 @@ static int __init cdns_uart_console_setup(struct console *co, char *options)
        if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS)
                return -EINVAL;
 
-       if (!port->mapbase) {
+       if (!port->membase) {
                pr_debug("console on " CDNS_UART_TTY_NAME "%i not present\n",
                         co->index);
                return -ENODEV;