serial-uclass: set GD_FLG_SERIAL_READY only when cur_serial_dev is assigned
serial_find_console_or_panic() may left cur_serial_dev unassigned if REQUIRE_SERIAL_CONSOLE is not set. Setting GD_FLG_SERIAL_READY in this situation confuses serial console code. It tries to use unassigned driver instead of debug port and stops printing. So check cur_serial_dev before setting GD_FLG_SERIAL_READY to allow console to keep printing via debug port. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
This commit is contained in:
committed by
Tom Rini
parent
2b751d42c3
commit
e4507f4a0a
@@ -191,7 +191,8 @@ int serial_init(void)
|
||||
{
|
||||
#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
|
||||
serial_find_console_or_panic();
|
||||
gd->flags |= GD_FLG_SERIAL_READY;
|
||||
if (gd->cur_serial_dev)
|
||||
gd->flags |= GD_FLG_SERIAL_READY;
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF_SERIAL_BAUD)) {
|
||||
int ret = 0;
|
||||
|
||||
Reference in New Issue
Block a user