aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pps/clients
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pps/clients')
-rw-r--r--drivers/pps/clients/pps-ktimer.c9
-rw-r--r--drivers/pps/clients/pps-ldisc.c18
2 files changed, 8 insertions, 19 deletions
diff --git a/drivers/pps/clients/pps-ktimer.c b/drivers/pps/clients/pps-ktimer.c
index e7ef5b8186d0..e1bdd8bc8c9c 100644
--- a/drivers/pps/clients/pps-ktimer.c
+++ b/drivers/pps/clients/pps-ktimer.c
@@ -40,18 +40,13 @@ static struct timer_list ktimer;
40 40
41static void pps_ktimer_event(unsigned long ptr) 41static void pps_ktimer_event(unsigned long ptr)
42{ 42{
43 struct timespec __ts; 43 struct pps_event_time ts;
44 struct pps_ktime ts;
45 44
46 /* First of all we get the time stamp... */ 45 /* First of all we get the time stamp... */
47 getnstimeofday(&__ts); 46 pps_get_ts(&ts);
48 47
49 pr_info("PPS event at %lu\n", jiffies); 48 pr_info("PPS event at %lu\n", jiffies);
50 49
51 /* ... and translate it to PPS time data struct */
52 ts.sec = __ts.tv_sec;
53 ts.nsec = __ts.tv_nsec;
54
55 pps_event(source, &ts, PPS_CAPTUREASSERT, NULL); 50 pps_event(source, &ts, PPS_CAPTUREASSERT, NULL);
56 51
57 mod_timer(&ktimer, jiffies + HZ); 52 mod_timer(&ktimer, jiffies + HZ);
diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c
index 8e1932d29fd4..20fc9f7645c8 100644
--- a/drivers/pps/clients/pps-ldisc.c
+++ b/drivers/pps/clients/pps-ldisc.c
@@ -27,26 +27,20 @@
27#define PPS_TTY_MAGIC 0x0001 27#define PPS_TTY_MAGIC 0x0001
28 28
29static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status, 29static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status,
30 struct timespec *ts) 30 struct pps_event_time *ts)
31{ 31{
32 int id = (long)tty->disc_data; 32 int id = (long)tty->disc_data;
33 struct timespec __ts; 33 struct pps_event_time __ts;
34 struct pps_ktime pps_ts;
35 34
36 /* First of all we get the time stamp... */ 35 /* First of all we get the time stamp... */
37 getnstimeofday(&__ts); 36 pps_get_ts(&__ts);
38 37
39 /* Does caller give us a timestamp? */ 38 /* Does caller give us a timestamp? */
40 if (ts) { /* Yes. Let's use it! */ 39 if (!ts) /* No. Do it ourself! */
41 pps_ts.sec = ts->tv_sec; 40 ts = &__ts;
42 pps_ts.nsec = ts->tv_nsec;
43 } else { /* No. Do it ourself! */
44 pps_ts.sec = __ts.tv_sec;
45 pps_ts.nsec = __ts.tv_nsec;
46 }
47 41
48 /* Now do the PPS event report */ 42 /* Now do the PPS event report */
49 pps_event(id, &pps_ts, status ? PPS_CAPTUREASSERT : PPS_CAPTURECLEAR, 43 pps_event(id, ts, status ? PPS_CAPTUREASSERT : PPS_CAPTURECLEAR,
50 NULL); 44 NULL);
51 45
52 pr_debug("PPS %s at %lu on source #%d\n", 46 pr_debug("PPS %s at %lu on source #%d\n",