Skip to content

Commit 5042ffb

Browse files
committed
Revert "serial-uartlite: Change logic how console_port is setup"
This reverts commit d338838. As Johan says, this driver needs a lot more work and these changes are only going in the wrong direction: https://lkml.kernel.org/r/20190523091839.GC568@localhost Reported-by: Johan Hovold <[email protected]> Cc: Shubhrajyoti Datta <[email protected]> Cc: Michal Simek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 61ad2a0 commit 5042ffb

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/tty/serial/uartlite.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq,
665665
* If register_console() don't assign value, then console_port pointer
666666
* is cleanup.
667667
*/
668-
if (!console_port)
668+
if (ulite_uart_driver.cons->index == -1)
669669
console_port = port;
670670
#endif
671671

@@ -680,8 +680,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq,
680680

681681
#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
682682
/* This is not port which is used for console that's why clean it up */
683-
if (console_port == port &&
684-
!(ulite_uart_driver.cons->flags & CON_ENABLED))
683+
if (ulite_uart_driver.cons->index == -1)
685684
console_port = NULL;
686685
#endif
687686

@@ -865,11 +864,6 @@ static int ulite_remove(struct platform_device *pdev)
865864

866865
clk_disable_unprepare(pdata->clk);
867866
rc = ulite_release(&pdev->dev);
868-
#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
869-
if (console_port == port)
870-
console_port = NULL;
871-
#endif
872-
873867
pm_runtime_disable(&pdev->dev);
874868
pm_runtime_set_suspended(&pdev->dev);
875869
pm_runtime_dont_use_autosuspend(&pdev->dev);

0 commit comments

Comments
 (0)