summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>2019-11-12 16:11:08 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-13 21:54:15 +0800
commitd338838c09dee338dd86f479f554d18401068978 (patch)
tree104ec2b6be32779478718f90413b18e0629ffb1c /drivers/tty
parent74887542fdcc92ad06a48c0cca17cdf09fc8aa00 (diff)
serial-uartlite: Change logic how console_port is setup
Change logic how console_port is setup by using CON_ENABLED flag instead of index. There will be unique uart_console structure that's why code can't use id for console_port assignment. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Link: https://lore.kernel.org/r/1573555271-2579-1-git-send-email-shubhrajyoti.datta@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/uartlite.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 3d245827be27..c93336189924 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -665,7 +665,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq,
* If register_console() don't assign value, then console_port pointer
* is cleanup.
*/
- if (ulite_uart_driver.cons->index == -1)
+ if (!console_port)
console_port = port;
#endif
@@ -680,7 +680,8 @@ 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 (ulite_uart_driver.cons->index == -1)
+ if (console_port == port &&
+ !(ulite_uart_driver.cons->flags & CON_ENABLED))
console_port = NULL;
#endif
@@ -864,6 +865,11 @@ static int ulite_remove(struct platform_device *pdev)
clk_disable_unprepare(pdata->clk);
rc = ulite_release(&pdev->dev);
+#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
+ if (console_port == port)
+ console_port = NULL;
+#endif
+
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);