serial-uartlite: Use allocated structure instead of static ones
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Tue, 12 Nov 2019 10:41:09 +0000 (16:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Nov 2019 13:54:15 +0000 (21:54 +0800)
Remove the use of the static uartlite structure.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/1573555271-2579-2-git-send-email-shubhrajyoti.datta@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/uartlite.c

index c93336189924771dba10808bcd03cf3ed3f05b24..2cced6a09254611037c1c4111bc327563b5c8ca2 100644 (file)
@@ -670,7 +670,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq,
 #endif
 
        /* Register the port */
-       rc = uart_add_one_port(&ulite_uart_driver, port);
+       rc = uart_add_one_port(pdata->ulite_uart_driver, port);
        if (rc) {
                dev_err(dev, "uart_add_one_port() failed; err=%i\n", rc);
                port->mapbase = 0;
@@ -681,7 +681,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq,
 #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
        /* This is not port which is used for console that's why clean it up */
        if (console_port == port &&
-           !(ulite_uart_driver.cons->flags & CON_ENABLED))
+           !(pdata->ulite_uart_driver->cons->flags & CON_ENABLED))
                console_port = NULL;
 #endif