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>
This commit is contained in:
Alexander Gordeev
2011-01-12 17:00:50 -08:00
committed by Linus Torvalds
parent 3003d55b59
commit 6f4229b511
6 changed files with 45 additions and 31 deletions

View File

@ -212,6 +212,7 @@
#include <linux/tty.h>
#include <linux/mutex.h>
#include <linux/sysrq.h>
#include <linux/pps_kernel.h>
struct uart_port;
struct serial_struct;
@ -528,10 +529,10 @@ 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 = tty_ldisc_ref(port->tty);
struct timespec ts;
struct pps_event_time ts;
if (ld && ld->ops->dcd_change)
getnstimeofday(&ts);
pps_get_ts(&ts);
uport->icount.dcd++;
#ifdef CONFIG_HARD_PPS