summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-10 20:23:57 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-28 14:17:42 -0800
commit39b3d8929f3d2104772046977ba0781eaf032df4 (patch)
tree5853fe3507eb733d96b5b5201bec8220876a99de
parent3abe8c7671a53f2243d1279a1017d3f4483d34c4 (diff)
serial: core: Use tty->index for port # in debug messages
The uart port may have already been removed by uart_remove_one_port(); use equivalent tty->index (which is always valid in these contexts) instead. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/serial_core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b1785d112e2e..1e7430c60ee6 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1381,8 +1381,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
uport = state->uart_port;
port = &state->port;
-
- pr_debug("uart_close(%d) called\n", uport ? uport->line : -1);
+ pr_debug("uart_close(%d) called\n", tty->index);
if (!port->count || tty_port_close_start(port, tty, filp) == 0)
return;
@@ -1500,7 +1499,7 @@ static void uart_hangup(struct tty_struct *tty)
struct tty_port *port = &state->port;
unsigned long flags;
- pr_debug("uart_hangup(%d)\n", state->uart_port->line);
+ pr_debug("uart_hangup(%d)\n", tty->index);
mutex_lock(&port->mutex);
if (port->flags & ASYNC_NORMAL_ACTIVE) {