Commit 42381572 authored by George Spelvin's avatar George Spelvin Committed by Greg Kroah-Hartman

pps: Additional cleanups in uart_handle_dcd_change

An extension of the previous commit, there is no semantic change
here, just fewer lines of source code.
Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
Acked-by: default avatarRodolfo Giometti <giometti@enneenne.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 593fb1ae
...@@ -2723,15 +2723,15 @@ EXPORT_SYMBOL(uart_match_port); ...@@ -2723,15 +2723,15 @@ EXPORT_SYMBOL(uart_match_port);
*/ */
void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
{ {
struct uart_state *state = uport->state; struct tty_port *port = &uport->state->port;
struct tty_port *port = &state->port;
struct tty_ldisc *ld = NULL;
struct tty_struct *tty = port->tty; struct tty_struct *tty = port->tty;
struct tty_ldisc *ld = tty ? tty_ldisc_ref(tty) : NULL;
if (tty) if (ld) {
ld = tty_ldisc_ref(tty); if (ld->ops->dcd_change)
if (ld && ld->ops->dcd_change) ld->ops->dcd_change(tty, status);
ld->ops->dcd_change(tty, status); tty_ldisc_deref(ld);
}
uport->icount.dcd++; uport->icount.dcd++;
#ifdef CONFIG_HARD_PPS #ifdef CONFIG_HARD_PPS
...@@ -2745,9 +2745,6 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) ...@@ -2745,9 +2745,6 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
else if (tty) else if (tty)
tty_hangup(tty); tty_hangup(tty);
} }
if (ld)
tty_ldisc_deref(ld);
} }
EXPORT_SYMBOL_GPL(uart_handle_dcd_change); EXPORT_SYMBOL_GPL(uart_handle_dcd_change);
......
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