summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-fh.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@maxwell.research.nokia.com>2010-03-27 11:02:10 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:58:07 -0300
commitd3d7c963562adad92e968df23c425ae964fe9ce2 (patch)
tree1677fc6591a417c7a2866a342b9270233d17c216 /drivers/media/video/v4l2-fh.c
parentc3b5b0241f620a356c97d8f43343e721c718806d (diff)
downloadop-kernel-dev-d3d7c963562adad92e968df23c425ae964fe9ce2.zip
op-kernel-dev-d3d7c963562adad92e968df23c425ae964fe9ce2.tar.gz
V4L/DVB: V4L: Events: Support event handling in do_ioctl
Add support for event handling to do_ioctl. Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-fh.c')
-rw-r--r--drivers/media/video/v4l2-fh.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-fh.c b/drivers/media/video/v4l2-fh.c
index aab2fb6..d78f184 100644
--- a/drivers/media/video/v4l2-fh.c
+++ b/drivers/media/video/v4l2-fh.c
@@ -34,7 +34,16 @@ int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
INIT_LIST_HEAD(&fh->list);
set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags);
- return v4l2_event_init(fh);
+ /*
+ * fh->events only needs to be initialized if the driver
+ * supports the VIDIOC_SUBSCRIBE_EVENT ioctl.
+ */
+ if (vdev->ioctl_ops && vdev->ioctl_ops->vidioc_subscribe_event)
+ return v4l2_event_init(fh);
+
+ fh->events = NULL;
+
+ return 0;
}
EXPORT_SYMBOL_GPL(v4l2_fh_init);
OpenPOWER on IntegriCloud