diff options
author | Alexander Gordeev <lasaine@lvk.cs.msu.su> | 2011-01-12 20:00:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:19 -0500 |
commit | 6f4229b51106cbc859e9d8209b22c8a2ec749e64 (patch) | |
tree | 346e08800b0f45330e99c9fae0255c73f1666835 /drivers/pps/clients/pps-ktimer.c | |
parent | 3003d55b59aa98aeaff2773df69732b27c0cbf6a (diff) |
pps: unify timestamp gathering
Add a helper function to gather timestamps. This way clients don't have
to duplicate it.
Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Acked-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pps/clients/pps-ktimer.c')
-rw-r--r-- | drivers/pps/clients/pps-ktimer.c | 9 |
1 files changed, 2 insertions, 7 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 | ||
41 | static void pps_ktimer_event(unsigned long ptr) | 41 | static 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); |