Browse Source

[media] v4l2-event: v4l2_event_queue: do nothing if vdev == NULL

If the vdev pointer == NULL, then just return.

This makes it easier for subdev drivers to use this function without having to
check if the sd->devnode pointer is NULL or not.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil 10 years ago
parent
commit
fb8dfda980
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/media/v4l2-core/v4l2-event.c

+ 3 - 0
drivers/media/v4l2-core/v4l2-event.c

@@ -172,6 +172,9 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)
 	unsigned long flags;
 	unsigned long flags;
 	struct timespec timestamp;
 	struct timespec timestamp;
 
 
+	if (vdev == NULL)
+		return;
+
 	ktime_get_ts(&timestamp);
 	ktime_get_ts(&timestamp);
 
 
 	spin_lock_irqsave(&vdev->fh_lock, flags);
 	spin_lock_irqsave(&vdev->fh_lock, flags);