drivers/serial: Don't call uart_shutdown if the serial work as a console

since uart_setup is skip at line 556 for the console device

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-12-17 03:25:27 +08:00 committed by Petro Karashchenko
parent d5689e070b
commit 9cc608e4c4

View File

@ -570,7 +570,11 @@ static int uart_open(FAR struct file *filep)
ret = uart_attach(dev);
if (ret < 0)
{
uart_shutdown(dev);
if (!dev->isconsole)
{
uart_shutdown(dev);
}
leave_critical_section(flags);
goto errout_with_lock;
}