diff options
author | George Spelvin <linux@horizon.com> | 2013-02-10 04:44:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-13 13:17:06 -0500 |
commit | 42381572f586d4da57e7d65e0fcb45422be3ba7b (patch) | |
tree | daf1547e12333175cc72aab0973fb9f09557a79d /drivers/tty | |
parent | 593fb1ae457aab28b392ac114f6e3358788da985 (diff) |
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: George Spelvin <linux@horizon.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 765be520cd2e..6ce40c1822fc 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -2723,15 +2723,15 @@ EXPORT_SYMBOL(uart_match_port); | |||
2723 | */ | 2723 | */ |
2724 | void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | 2724 | void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) |
2725 | { | 2725 | { |
2726 | struct uart_state *state = uport->state; | 2726 | struct tty_port *port = &uport->state->port; |
2727 | struct tty_port *port = &state->port; | ||
2728 | struct tty_ldisc *ld = NULL; | ||
2729 | struct tty_struct *tty = port->tty; | 2727 | struct tty_struct *tty = port->tty; |
2728 | struct tty_ldisc *ld = tty ? tty_ldisc_ref(tty) : NULL; | ||
2730 | 2729 | ||
2731 | if (tty) | 2730 | if (ld) { |
2732 | ld = tty_ldisc_ref(tty); | 2731 | if (ld->ops->dcd_change) |
2733 | if (ld && ld->ops->dcd_change) | 2732 | ld->ops->dcd_change(tty, status); |
2734 | ld->ops->dcd_change(tty, status); | 2733 | tty_ldisc_deref(ld); |
2734 | } | ||
2735 | 2735 | ||
2736 | uport->icount.dcd++; | 2736 | uport->icount.dcd++; |
2737 | #ifdef CONFIG_HARD_PPS | 2737 | #ifdef CONFIG_HARD_PPS |
@@ -2745,9 +2745,6 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
2745 | else if (tty) | 2745 | else if (tty) |
2746 | tty_hangup(tty); | 2746 | tty_hangup(tty); |
2747 | } | 2747 | } |
2748 | |||
2749 | if (ld) | ||
2750 | tty_ldisc_deref(ld); | ||
2751 | } | 2748 | } |
2752 | EXPORT_SYMBOL_GPL(uart_handle_dcd_change); | 2749 | EXPORT_SYMBOL_GPL(uart_handle_dcd_change); |
2753 | 2750 | ||