aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/serial_core.c
diff options
context:
space:
mode:
authorGeorge Spelvin <linux@horizon.com>2013-02-12 02:00:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-13 10:13:58 -0800
commit593fb1ae457aab28b392ac114f6e3358788da985 (patch)
tree6f8cc5465000eb8c148bc0d20f957a85e873966a /drivers/tty/serial/serial_core.c
parentce3da1a654c83c6c9cb0b33477815e5d1293cc00 (diff)
pps: Move timestamp read into PPS code proper
The PPS (Pulse-Per-Second) line discipline has developed a number of unhealthy attachments to core tty data and functions, ultimately leading to its breakage. The previous patches fixed the crashing. This one reduces coupling further by eliminating the timestamp parameter from the dcd_change ldisc method. This reduces header file linkage and makes the extension more generic, and the timestamp read is delayed only slightly, from just before the ldisc->ops->dcd_change method call to just after. Fix attendant build breakage in drivers/tty/n_tty.c drivers/tty/tty_buffer.c drivers/staging/speakup/selection.c drivers/staging/dgrp/dgrp_*.c Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@braille.uwo.ca> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> 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/serial/serial_core.c')
-rw-r--r--drivers/tty/serial/serial_core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index ca98a3f65fe..765be520cd2 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2726,13 +2726,12 @@ 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 pps_event_time ts;
struct tty_struct *tty = port->tty;
if (tty)
ld = tty_ldisc_ref(tty);
if (ld && ld->ops->dcd_change)
- pps_get_ts(&ts);
+ ld->ops->dcd_change(tty, status);
uport->icount.dcd++;
#ifdef CONFIG_HARD_PPS
@@ -2747,8 +2746,6 @@ void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
tty_hangup(tty);
}
- if (ld && ld->ops->dcd_change)
- ld->ops->dcd_change(tty, status, &ts);
if (ld)
tty_ldisc_deref(ld);
}