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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_v4l2.c b/linux/drivers/media/video/uvc/uvc_v4l2.c
index 624bf74de..5588698e2 100644
--- a/linux/drivers/media/video/uvc/uvc_v4l2.c
+++ b/linux/drivers/media/video/uvc/uvc_v4l2.c
@@ -413,14 +413,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 +463,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;
}