aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-subdev.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-06-13 16:44:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:31 -0400
commit523f46d6aba9dcb0a2d0fc474ca884e93a7cf198 (patch)
tree5c73cecf3d9786868ac03c93f7df2df6a465d9a6 /drivers/media/video/v4l2-subdev.c
parent95904d4b6a188ea2f0f1781498f6ca626e21b9ac (diff)
[media] v4l2-events/fh: merge v4l2_events into v4l2_fh
Drivers that supported events used to be rare, but now that controls can also raise events this will become much more common since almost all drivers have controls. This means that keeping struct v4l2_events as a separate struct make no more sense. Merging it into struct v4l2_fh simplifies things substantially as it is now an integral part of the filehandle struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-subdev.c')
-rw-r--r--drivers/media/video/v4l2-subdev.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c
index fd5dccaf3519..3b67a8584916 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -75,15 +75,9 @@ static int subdev_open(struct file *file)
75 return ret; 75 return ret;
76 } 76 }
77 77
78 ret = v4l2_fh_init(&subdev_fh->vfh, vdev); 78 v4l2_fh_init(&subdev_fh->vfh, vdev);
79 if (ret)
80 goto err;
81 79
82 if (sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS) { 80 if (sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS) {
83 ret = v4l2_event_init(&subdev_fh->vfh);
84 if (ret)
85 goto err;
86
87 ret = v4l2_event_alloc(&subdev_fh->vfh, sd->nevents); 81 ret = v4l2_event_alloc(&subdev_fh->vfh, sd->nevents);
88 if (ret) 82 if (ret)
89 goto err; 83 goto err;
@@ -297,7 +291,7 @@ static unsigned int subdev_poll(struct file *file, poll_table *wait)
297 if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS)) 291 if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
298 return POLLERR; 292 return POLLERR;
299 293
300 poll_wait(file, &fh->events->wait, wait); 294 poll_wait(file, &fh->wait, wait);
301 295
302 if (v4l2_event_pending(fh)) 296 if (v4l2_event_pending(fh))
303 return POLLPRI; 297 return POLLPRI;