Skip to content

Commit

Permalink
pps: Additional cleanups in uart_handle_dcd_change
Browse files Browse the repository at this point in the history
An extension of the previous commit, there is no semantic change
here, just fewer lines of source code.

Signed-off-by: George Spelvin <linux@horizon.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
George Spelvin authored and Greg Kroah-Hartman committed Feb 13, 2013
1 parent 593fb1a commit 4238157
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2723,15 +2723,15 @@ EXPORT_SYMBOL(uart_match_port);
*/
void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
{
struct uart_state *state = uport->state;
struct tty_port *port = &state->port;
struct tty_ldisc *ld = NULL;
struct tty_port *port = &uport->state->port;
struct tty_struct *tty = port->tty;
struct tty_ldisc *ld = tty ? tty_ldisc_ref(tty) : NULL;

if (tty)
ld = tty_ldisc_ref(tty);
if (ld && ld->ops->dcd_change)
ld->ops->dcd_change(tty, status);
if (ld) {
if (ld->ops->dcd_change)
ld->ops->dcd_change(tty, status);
tty_ldisc_deref(ld);
}

uport->icount.dcd++;
#ifdef CONFIG_HARD_PPS
Expand All @@ -2745,9 +2745,6 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
else if (tty)
tty_hangup(tty);
}

if (ld)
tty_ldisc_deref(ld);
}
EXPORT_SYMBOL_GPL(uart_handle_dcd_change);

Expand Down

0 comments on commit 4238157

Please sign in to comment.