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 <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
9cc608e4c4
commit
4b3ea5b052
@ -255,17 +255,9 @@ static int tty_setup(struct uart_dev_s *dev)
|
|||||||
{
|
{
|
||||||
struct tty_priv_s *priv = dev->priv;
|
struct tty_priv_s *priv = dev->priv;
|
||||||
|
|
||||||
if (!dev->isconsole && priv->fd < 0)
|
|
||||||
{
|
|
||||||
priv->fd = host_uart_open(priv->path);
|
priv->fd = host_uart_open(priv->path);
|
||||||
if (priv->fd < 0)
|
|
||||||
{
|
|
||||||
return priv->fd;
|
return priv->fd;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: tty_shutdown
|
* Name: tty_shutdown
|
||||||
@ -280,14 +272,11 @@ static void tty_shutdown(struct uart_dev_s *dev)
|
|||||||
{
|
{
|
||||||
struct tty_priv_s *priv = dev->priv;
|
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);
|
host_uart_close(priv->fd);
|
||||||
priv->fd = -1;
|
priv->fd = -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: tty_attach
|
* Name: tty_attach
|
||||||
|
Loading…
Reference in New Issue
Block a user