diff options
author | Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | 2010-03-27 10:02:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:07 -0400 |
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 aab2fb639ef1..d78f184f40c5 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) | |||
34 | INIT_LIST_HEAD(&fh->list); | 34 | INIT_LIST_HEAD(&fh->list); |
35 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); | 35 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); |
36 | 36 | ||
37 | return v4l2_event_init(fh); | 37 | /* |
38 | * fh->events only needs to be initialized if the driver | ||
39 | * supports the VIDIOC_SUBSCRIBE_EVENT ioctl. | ||
40 | */ | ||
41 | if (vdev->ioctl_ops && vdev->ioctl_ops->vidioc_subscribe_event) | ||
42 | return v4l2_event_init(fh); | ||
43 | |||
44 | fh->events = NULL; | ||
45 | |||
46 | return 0; | ||
38 | } | 47 | } |
39 | EXPORT_SYMBOL_GPL(v4l2_fh_init); | 48 | EXPORT_SYMBOL_GPL(v4l2_fh_init); |
40 | 49 | ||