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>
{
#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;