summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/uvc/uvc_v4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/uvc/uvc_v4l2.c')
-rw-r--r--linux/drivers/media/video/uvc/uvc_v4l2.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_v4l2.c b/linux/drivers/media/video/uvc/uvc_v4l2.c
index 836136780..b6ee9aac6 100644
--- a/linux/drivers/media/video/uvc/uvc_v4l2.c
+++ b/linux/drivers/media/video/uvc/uvc_v4l2.c
@@ -252,9 +252,6 @@ static int uvc_v4l2_set_format(struct uvc_video_device *video,
if (ret < 0)
return ret;
- if ((ret = uvc_set_video_ctrl(video, &probe, 0)) < 0)
- return ret;
-
memcpy(&video->streaming->ctrl, &probe, sizeof probe);
video->streaming->cur_format = format;
video->streaming->cur_frame = frame;
@@ -315,10 +312,6 @@ static int uvc_v4l2_set_streamparm(struct uvc_video_device *video,
if ((ret = uvc_probe_video(video, &probe)) < 0)
return ret;
- /* Commit the new settings. */
- if ((ret = uvc_set_video_ctrl(video, &probe, 0)) < 0)
- return ret;
-
memcpy(&video->streaming->ctrl, &probe, sizeof probe);
/* Return the actual frame period. */
@@ -413,14 +406,18 @@ static int uvc_v4l2_open(struct inode *inode, struct file *file)
goto done;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
ret = usb_autopm_get_interface(video->dev->intf);
if (ret < 0)
goto done;
+#endif
/* Create the device handle. */
handle = kzalloc(sizeof *handle, GFP_KERNEL);
if (handle == NULL) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
usb_autopm_put_interface(video->dev->intf);
+#endif
ret = -ENOMEM;
goto done;
}
@@ -459,7 +456,9 @@ static int uvc_v4l2_release(struct inode *inode, struct file *file)
kfree(handle);
file->private_data = NULL;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
usb_autopm_put_interface(video->dev->intf);
+#endif
kref_put(&video->dev->kref, uvc_delete);
return 0;
}
@@ -471,9 +470,6 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
int ret = 0;
- if (uvc_trace_param & UVC_TRACE_IOCTL)
- v4l_printk_ioctl(cmd);
-
switch (cmd) {
/* Query capabilities */
case VIDIOC_QUERYCAP:
@@ -924,7 +920,7 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- info = kmalloc(sizeof *info, GFP_KERNEL);
+ info = kzalloc(sizeof *info, GFP_KERNEL);
if (info == NULL)
return -ENOMEM;
@@ -951,7 +947,7 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- map = kmalloc(sizeof *map, GFP_KERNEL);
+ map = kzalloc(sizeof *map, GFP_KERNEL);
if (map == NULL)
return -ENOMEM;
@@ -990,7 +986,12 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_ioctl\n");
+ if (uvc_trace_param & UVC_TRACE_IOCTL) {
+ uvc_printk(KERN_DEBUG, "uvc_v4l2_ioctl(");
+ v4l_printk_ioctl(cmd);
+ printk(")\n");
+ }
+
return video_usercopy(file, cmd, arg, uvc_v4l2_do_ioctl);
}