aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/uvc_v4l2.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-09-15 09:08:05 -0400
committerJiri Kosina <jkosina@suse.cz>2011-09-15 09:08:18 -0400
commite060c38434b2caa78efe7cedaff4191040b65a15 (patch)
tree407361230bf6733f63d8e788e4b5e6566ee04818 /drivers/usb/gadget/uvc_v4l2.c
parent10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff)
parentcc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff)
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches based on more recent version of the tree.
Diffstat (limited to 'drivers/usb/gadget/uvc_v4l2.c')
-rw-r--r--drivers/usb/gadget/uvc_v4l2.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c
index a7158053276a..cfb58384394d 100644
--- a/drivers/usb/gadget/uvc_v4l2.c
+++ b/drivers/usb/gadget/uvc_v4l2.c
@@ -123,24 +123,12 @@ uvc_v4l2_open(struct file *file)
123 struct video_device *vdev = video_devdata(file); 123 struct video_device *vdev = video_devdata(file);
124 struct uvc_device *uvc = video_get_drvdata(vdev); 124 struct uvc_device *uvc = video_get_drvdata(vdev);
125 struct uvc_file_handle *handle; 125 struct uvc_file_handle *handle;
126 int ret;
127 126
128 handle = kzalloc(sizeof(*handle), GFP_KERNEL); 127 handle = kzalloc(sizeof(*handle), GFP_KERNEL);
129 if (handle == NULL) 128 if (handle == NULL)
130 return -ENOMEM; 129 return -ENOMEM;
131 130
132 ret = v4l2_fh_init(&handle->vfh, vdev); 131 v4l2_fh_init(&handle->vfh, vdev);
133 if (ret < 0)
134 goto error;
135
136 ret = v4l2_event_init(&handle->vfh);
137 if (ret < 0)
138 goto error;
139
140 ret = v4l2_event_alloc(&handle->vfh, 8);
141 if (ret < 0)
142 goto error;
143
144 v4l2_fh_add(&handle->vfh); 132 v4l2_fh_add(&handle->vfh);
145 133
146 handle->device = &uvc->video; 134 handle->device = &uvc->video;
@@ -148,10 +136,6 @@ uvc_v4l2_open(struct file *file)
148 136
149 uvc_function_connect(uvc); 137 uvc_function_connect(uvc);
150 return 0; 138 return 0;
151
152error:
153 v4l2_fh_exit(&handle->vfh);
154 return ret;
155} 139}
156 140
157static int 141static int
@@ -313,7 +297,7 @@ uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
313 if (sub->type < UVC_EVENT_FIRST || sub->type > UVC_EVENT_LAST) 297 if (sub->type < UVC_EVENT_FIRST || sub->type > UVC_EVENT_LAST)
314 return -EINVAL; 298 return -EINVAL;
315 299
316 return v4l2_event_subscribe(&handle->vfh, arg); 300 return v4l2_event_subscribe(&handle->vfh, arg, 2);
317 } 301 }
318 302
319 case VIDIOC_UNSUBSCRIBE_EVENT: 303 case VIDIOC_UNSUBSCRIBE_EVENT:
@@ -353,7 +337,7 @@ uvc_v4l2_poll(struct file *file, poll_table *wait)
353 struct uvc_file_handle *handle = to_uvc_file_handle(file->private_data); 337 struct uvc_file_handle *handle = to_uvc_file_handle(file->private_data);
354 unsigned int mask = 0; 338 unsigned int mask = 0;
355 339
356 poll_wait(file, &handle->vfh.events->wait, wait); 340 poll_wait(file, &handle->vfh.wait, wait);
357 if (v4l2_event_pending(&handle->vfh)) 341 if (v4l2_event_pending(&handle->vfh))
358 mask |= POLLPRI; 342 mask |= POLLPRI;
359 343