This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 4b3ea5b0523a3a084756f76b41d2af1e360b46d6
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sat Dec 17 03:29:18 2022 +0800

    arch/sim: Don't need check isconsole in tty_setup and tty_shutdown
    
    since serial framework never call these callbacks in case of console
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 arch/sim/src/sim/sim_uart.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/arch/sim/src/sim/sim_uart.c b/arch/sim/src/sim/sim_uart.c
index 87410d37d9..7d8b4dc7bd 100644
--- a/arch/sim/src/sim/sim_uart.c
+++ b/arch/sim/src/sim/sim_uart.c
@@ -255,16 +255,8 @@ static int tty_setup(struct uart_dev_s *dev)
 {
   struct tty_priv_s *priv = dev->priv;
 
-  if (!dev->isconsole && priv->fd < 0)
-    {
-      priv->fd = host_uart_open(priv->path);
-      if (priv->fd < 0)
-        {
-          return priv->fd;
-        }
-    }
-
-  return OK;
+  priv->fd = host_uart_open(priv->path);
+  return priv->fd;
 }
 
 /****************************************************************************
@@ -280,13 +272,10 @@ static void tty_shutdown(struct uart_dev_s *dev)
 {
   struct tty_priv_s *priv = dev->priv;
 
-  if (!dev->isconsole && priv->fd >= 0)
-    {
-      /* close file Description and reset fd */
+  /* close file Description and reset fd */
 
-      host_uart_close(priv->fd);
-      priv->fd = -1;
-    }
+  host_uart_close(priv->fd);
+  priv->fd = -1;
 }
 
 /****************************************************************************

Reply via email to