summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-event.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-05-07 21:53:20 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 13:43:06 +0200
commit6e6d76cdc541e28bf4f609141d76c488c6c0d263 (patch)
tree479d1c19b79849098e35b6e2f604794541f0fe0b /drivers/media/video/v4l2-event.c
parentMerge remote-tracking branch 'linus/master' into staging/for_v3.5 (diff)
downloadlinux-6e6d76cdc541e28bf4f609141d76c488c6c0d263.tar.xz
linux-6e6d76cdc541e28bf4f609141d76c488c6c0d263.zip
[media] v4l2-event: fix regression with initial event handling
If the V4L2_EVENT_SUB_FL_SEND_INITIAL was set, then the application expects to receive an initial event of the initial value of the control. However, commit c53c2549333b340e2662dc64ec81323476b69a97 that added the new v4l2_subscribed_event_ops introduced a regression: while the code still queued that initial event the __v4l2_event_queue_fh() function was modified to ignore such requests if sev->elems was 0 (meaning that the event subscription wasn't finished yet). And sev->elems was only set to a non-zero value after the add operation returned. This patch fixes this by passing the elems value to the add function. Then the add function can set it before queuing the initial event. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-event.c')
-rw-r--r--drivers/media/video/v4l2-event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index 60b4e2e9c874..ef2a33c94045 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -239,7 +239,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
}
if (sev->ops && sev->ops->add) {
- int ret = sev->ops->add(sev);
+ int ret = sev->ops->add(sev, elems);
if (ret) {
sev->ops = NULL;
v4l2_event_unsubscribe(fh, sub);