diff options
Diffstat (limited to 'drivers/pps/clients/pps-ldisc.c')
-rw-r--r-- | drivers/pps/clients/pps-ldisc.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c index 8e1932d29fd..20fc9f7645c 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 | ||
29 | static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status, | 29 | static 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", |