diff options
author | Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | 2010-03-27 11:02:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 12:58:07 -0300 |
commit | d3d7c963562adad92e968df23c425ae964fe9ce2 (patch) | |
tree | 1677fc6591a417c7a2866a342b9270233d17c216 /drivers/media/video/v4l2-fh.c | |
parent | c3b5b0241f620a356c97d8f43343e721c718806d (diff) |
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.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-fh.c b/drivers/media/video/v4l2-fh.c index aab2fb639ef..d78f184f40c 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); |