Commit 3e3b5c08 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds
Browse files

tty: use prepare/finish_wait

Use prepare_to_wait and finish_wait instead of add_wait_queue and

This avoids us setting a task state.
Signed-off-by: default avatarJiri Slaby <>
Signed-off-by: default avatarAlan Cox <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5fc5b42a
......@@ -222,7 +222,6 @@ int tty_port_block_til_ready(struct tty_port *port,
before the next open may complete */
retval = 0;
add_wait_queue(&port->open_wait, &wait);
/* The port lock protects the port counts */
spin_lock_irqsave(&port->lock, flags);
......@@ -236,7 +235,7 @@ int tty_port_block_til_ready(struct tty_port *port,
if (tty->termios->c_cflag & CBAUD)
prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE);
/* Check for a hangup or uninitialised port. Return accordingly */
if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) {
if (port->flags & ASYNC_HUP_NOTIFY)
......@@ -257,8 +256,7 @@ int tty_port_block_til_ready(struct tty_port *port,
remove_wait_queue(&port->open_wait, &wait);
finish_wait(&port->open_wait, &wait);
/* Update counts. A parallel hangup will have set count to zero and
we must not mess that up further */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment