aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pps
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 13:13:58 -0500
commit593fb1ae457aab28b392ac114f6e3358788da985 (patch)
tree6f8cc5465000eb8c148bc0d20f957a85e873966a /drivers/pps
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/pps')
-rw-r--r--drivers/pps/clients/pps-ldisc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c
index a94f73e1480d..73bd3bb4d93b 100644
--- a/drivers/pps/clients/pps-ldisc.c
+++ b/drivers/pps/clients/pps-ldisc.c
@@ -29,11 +29,14 @@
29 29
30#define PPS_TTY_MAGIC 0x0001 30#define PPS_TTY_MAGIC 0x0001
31 31
32static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status, 32static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status)
33 struct pps_event_time *ts)
34{ 33{
35 struct pps_device *pps = pps_lookup_dev(tty); 34 struct pps_device *pps;
35 struct pps_event_time ts;
36
37 pps_get_ts(&ts);
36 38
39 pps = pps_lookup_dev(tty);
37 /* 40 /*
38 * This should never fail, but the ldisc locking is very 41 * This should never fail, but the ldisc locking is very
39 * convoluted, so don't crash just in case. 42 * convoluted, so don't crash just in case.
@@ -42,7 +45,7 @@ static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status,
42 return; 45 return;
43 46
44 /* Now do the PPS event report */ 47 /* Now do the PPS event report */
45 pps_event(pps, ts, status ? PPS_CAPTUREASSERT : 48 pps_event(pps, &ts, status ? PPS_CAPTUREASSERT :
46 PPS_CAPTURECLEAR, NULL); 49 PPS_CAPTURECLEAR, NULL);
47 50
48 dev_dbg(pps->dev, "PPS %s at %lu\n", 51 dev_dbg(pps->dev, "PPS %s at %lu\n",