diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-03-07 09:55:48 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:27:53 -0400 |
commit | 8bde9658a0e6a7098dcda1ce6ea6b278029644b4 (patch) | |
tree | c145dc5808d6c93809bd07dd083191165d14da4c /drivers/tty/tty_port.c | |
parent | b12d8dc2dbe2d2d1d6eec314d586b1eed75756dc (diff) |
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: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_port.c')
-rw-r--r-- | drivers/tty/tty_port.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 7f38eeaafac3..2aea2f91e271 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c | |||
@@ -199,9 +199,14 @@ EXPORT_SYMBOL(tty_port_tty_set); | |||
199 | static void tty_port_shutdown(struct tty_port *port) | 199 | static void tty_port_shutdown(struct tty_port *port) |
200 | { | 200 | { |
201 | mutex_lock(&port->mutex); | 201 | mutex_lock(&port->mutex); |
202 | if (port->ops->shutdown && !port->console && | 202 | if (port->console) |
203 | test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) | 203 | goto out; |
204 | |||
205 | if (test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) { | ||
206 | if (port->ops->shutdown) | ||
204 | port->ops->shutdown(port); | 207 | port->ops->shutdown(port); |
208 | } | ||
209 | out: | ||
205 | mutex_unlock(&port->mutex); | 210 | mutex_unlock(&port->mutex); |
206 | } | 211 | } |
207 | 212 | ||