diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-06-11 09:33:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-11 11:51:07 -0400 |
commit | 3e3b5c087799e536871c8261b05bc28e4783c8da (patch) | |
tree | fc8841b45f3326c79eda03c0d98e8a11c5125938 | |
parent | 5fc5b42a3bb564f0b6e03f0f1b522ed9100250ad (diff) |
tty: use prepare/finish_wait
Use prepare_to_wait and finish_wait instead of add_wait_queue and
remove_wait_queue.
This avoids us setting a task state.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/char/tty_port.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c index 931af1030740..62dadfc95e34 100644 --- a/drivers/char/tty_port.c +++ b/drivers/char/tty_port.c | |||
@@ -222,7 +222,6 @@ int tty_port_block_til_ready(struct tty_port *port, | |||
222 | before the next open may complete */ | 222 | before the next open may complete */ |
223 | 223 | ||
224 | retval = 0; | 224 | retval = 0; |
225 | add_wait_queue(&port->open_wait, &wait); | ||
226 | 225 | ||
227 | /* The port lock protects the port counts */ | 226 | /* The port lock protects the port counts */ |
228 | spin_lock_irqsave(&port->lock, flags); | 227 | spin_lock_irqsave(&port->lock, flags); |
@@ -236,7 +235,7 @@ int tty_port_block_til_ready(struct tty_port *port, | |||
236 | if (tty->termios->c_cflag & CBAUD) | 235 | if (tty->termios->c_cflag & CBAUD) |
237 | tty_port_raise_dtr_rts(port); | 236 | tty_port_raise_dtr_rts(port); |
238 | 237 | ||
239 | set_current_state(TASK_INTERRUPTIBLE); | 238 | prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE); |
240 | /* Check for a hangup or uninitialised port. Return accordingly */ | 239 | /* Check for a hangup or uninitialised port. Return accordingly */ |
241 | if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) { | 240 | if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) { |
242 | if (port->flags & ASYNC_HUP_NOTIFY) | 241 | if (port->flags & ASYNC_HUP_NOTIFY) |
@@ -257,8 +256,7 @@ int tty_port_block_til_ready(struct tty_port *port, | |||
257 | } | 256 | } |
258 | schedule(); | 257 | schedule(); |
259 | } | 258 | } |
260 | set_current_state(TASK_RUNNING); | 259 | finish_wait(&port->open_wait, &wait); |
261 | remove_wait_queue(&port->open_wait, &wait); | ||
262 | 260 | ||
263 | /* Update counts. A parallel hangup will have set count to zero and | 261 | /* Update counts. A parallel hangup will have set count to zero and |
264 | we must not mess that up further */ | 262 | we must not mess that up further */ |