From 5ba0e2c3ad4c049b19f6cad7ec62e59424a55183 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 17 Sep 2015 18:19:37 -0300 Subject: [media] use v4l2_get_timestamp where possible This is a preparation for a change to the type of v4l2 timestamps. v4l2_get_timestamp() is a helper function that reads the monotonic time and stores it into a 'struct timeval'. Multiple drivers implement the same thing themselves for historic reasons. Changing them all to use v4l2_get_timestamp() is more consistent and reduces the amount of code duplication, and most importantly simplifies the following changes. Signed-off-by: Arnd Bergmann Acked-by: Sylwester Nawrocki [hans.verkuil@cisco.com: dropped the v4l2-dev.c patch that didn't belong here] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/omap4iss/iss_video.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c index 40405d8..485a90c 100644 --- a/drivers/staging/media/omap4iss/iss_video.c +++ b/drivers/staging/media/omap4iss/iss_video.c @@ -420,7 +420,6 @@ struct iss_buffer *omap4iss_video_buffer_next(struct iss_video *video) enum iss_pipeline_state state; struct iss_buffer *buf; unsigned long flags; - struct timespec ts; spin_lock_irqsave(&video->qlock, flags); if (WARN_ON(list_empty(&video->dmaqueue))) { @@ -433,9 +432,7 @@ struct iss_buffer *omap4iss_video_buffer_next(struct iss_video *video) list_del(&buf->list); spin_unlock_irqrestore(&video->qlock, flags); - ktime_get_ts(&ts); - buf->vb.v4l2_buf.timestamp.tv_sec = ts.tv_sec; - buf->vb.v4l2_buf.timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC; + v4l2_get_timestamp(&buf->vb.v4l2_buf.timestamp); /* Do frame number propagation only if this is the output video node. * Frame number either comes from the CSI receivers or it gets -- cgit v1.1