提交 8bde9658 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

TTY: clean up port shutdown

Untangle port-shutdown logic and make sure the initialised flag is
always cleared for non-console ports.
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b12d8dc2
...@@ -199,9 +199,14 @@ EXPORT_SYMBOL(tty_port_tty_set); ...@@ -199,9 +199,14 @@ EXPORT_SYMBOL(tty_port_tty_set);
static void tty_port_shutdown(struct tty_port *port) static void tty_port_shutdown(struct tty_port *port)
{ {
mutex_lock(&port->mutex); mutex_lock(&port->mutex);
if (port->ops->shutdown && !port->console && if (port->console)
test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) goto out;
if (test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) {
if (port->ops->shutdown)
port->ops->shutdown(port); port->ops->shutdown(port);
}
out:
mutex_unlock(&port->mutex); mutex_unlock(&port->mutex);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册