<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,2 @@
 #!/bin/sh
-echo &quot;#define DRIVER_VERSION	\&quot;SVN r246-flip\&quot;&quot;
+echo &quot;#define DRIVER_VERSION	\&quot;SVN r261-flip\&quot;&quot;</diff>
      <filename>svn-version.sh</filename>
    </modified>
    <modified>
      <diff>@@ -271,7 +271,7 @@ v4l_printk_ioctl(unsigned int cmd)
  * Backported to 2.6.18 in Red Hat Enterprise Linux 5.2
  */
 #ifdef RHEL_RELEASE_CODE
-#if RHEL_RELEASE_CODE &lt; RHEL_RELEASE_VERSION(5,2)
+#if RHEL_RELEASE_CODE &gt;= RHEL_RELEASE_VERSION(5,2)
 #define RHEL_HAS_USB_ENDPOINT
 #endif
 #endif
@@ -317,6 +317,12 @@ static inline int usb_autopm_get_interface(struct usb_interface *intf)
 static inline void usb_autopm_put_interface(struct usb_interface *intf)
 { }
 
+/*
+ * DIV_ROUND_UP() macro
+ *
+ * Included in Linux 2.6.19
+ */
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 #endif
 
 #if LINUX_VERSION_CODE &lt; KERNEL_VERSION(2,6,22)
@@ -332,6 +338,18 @@ static inline void usb_autopm_put_interface(struct usb_interface *intf)
 #define uninitialized_var(x) x
 #endif
 
+#if LINUX_VERSION_CODE &lt; KERNEL_VERSION(2,6,28)
+#if defined(OBSOLETE_OWNER) || defined(OBSOLETE_DEVDATA)
+/*
+ * video_drvdata()
+ */
+static inline void *video_drvdata(struct file *file)
+{
+	return video_get_drvdata(video_devdata(file));
+}
+#endif
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif /* _UVC_COMPAT_H */</diff>
      <filename>uvc_compat.h</filename>
    </modified>
    <modified>
      <diff>@@ -85,6 +85,22 @@ static struct uvc_control_info uvc_ctrls[] = {
 	},
 	{
 		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_WHITE_BALANCE_TEMPERATURE_CONTROL,
+		.index		= 6,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_WHITE_BALANCE_COMPONENT_CONTROL,
+		.index		= 7,
+		.size		= 4,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
 		.selector	= PU_BACKLIGHT_COMPENSATION_CONTROL,
 		.index		= 8,
 		.size		= 2,
@@ -116,6 +132,60 @@ static struct uvc_control_info uvc_ctrls[] = {
 				| UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE,
 	},
 	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,
+		.index		= 12,
+		.size		= 1,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
+				| UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL,
+		.index		= 13,
+		.size		= 1,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
+				| UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_DIGITAL_MULTIPLIER_CONTROL,
+		.index		= 14,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL,
+		.index		= 15,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_ANALOG_VIDEO_STANDARD_CONTROL,
+		.index		= 16,
+		.size		= 1,
+		.flags		= UVC_CONTROL_GET_CUR,
+	},
+	{
+		.entity		= UVC_GUID_UVC_PROCESSING,
+		.selector	= PU_ANALOG_LOCK_STATUS_CONTROL,
+		.index		= 17,
+		.size		= 1,
+		.flags		= UVC_CONTROL_GET_CUR,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_SCANNING_MODE_CONTROL,
+		.index		= 0,
+		.size		= 1,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
+				| UVC_CONTROL_RESTORE,
+	},
+	{
 		.entity		= UVC_GUID_UVC_CAMERA,
 		.selector	= CT_AE_MODE_CONTROL,
 		.index		= 1,
@@ -142,6 +212,14 @@ static struct uvc_control_info uvc_ctrls[] = {
 	},
 	{
 		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_EXPOSURE_TIME_RELATIVE_CONTROL,
+		.index		= 4,
+		.size		= 1,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
+				| UVC_CONTROL_RESTORE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
 		.selector	= CT_FOCUS_ABSOLUTE_CONTROL,
 		.index		= 5,
 		.size		= 2,
@@ -150,42 +228,90 @@ static struct uvc_control_info uvc_ctrls[] = {
 	},
 	{
 		.entity		= UVC_GUID_UVC_CAMERA,
-		.selector	= CT_FOCUS_AUTO_CONTROL,
-		.index		= 17,
-		.size		= 1,
-		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
-				| UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE,
+		.selector	= CT_FOCUS_RELATIVE_CONTROL,
+		.index		= 6,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_AUTO_UPDATE,
 	},
 	{
-		.entity		= UVC_GUID_UVC_PROCESSING,
-		.selector	= PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,
-		.index		= 12,
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_IRIS_ABSOLUTE_CONTROL,
+		.index		= 7,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_IRIS_RELATIVE_CONTROL,
+		.index		= 8,
 		.size		= 1,
 		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
-				| UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE,
+				| UVC_CONTROL_AUTO_UPDATE,
 	},
 	{
-		.entity		= UVC_GUID_UVC_PROCESSING,
-		.selector	= PU_WHITE_BALANCE_TEMPERATURE_CONTROL,
-		.index		= 6,
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_ZOOM_ABSOLUTE_CONTROL,
+		.index		= 9,
 		.size		= 2,
 		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
 				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
 	},
 	{
-		.entity		= UVC_GUID_UVC_PROCESSING,
-		.selector	= PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL,
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_ZOOM_RELATIVE_CONTROL,
+		.index		= 10,
+		.size		= 3,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_PANTILT_ABSOLUTE_CONTROL,
+		.index		= 11,
+		.size		= 8,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_PANTILT_RELATIVE_CONTROL,
+		.index		= 12,
+		.size		= 4,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_ROLL_ABSOLUTE_CONTROL,
 		.index		= 13,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_ROLL_RELATIVE_CONTROL,
+		.index		= 14,
+		.size		= 2,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+				| UVC_CONTROL_AUTO_UPDATE,
+	},
+	{
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_FOCUS_AUTO_CONTROL,
+		.index		= 17,
 		.size		= 1,
 		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
 				| UVC_CONTROL_GET_DEF | UVC_CONTROL_RESTORE,
 	},
 	{
-		.entity		= UVC_GUID_UVC_PROCESSING,
-		.selector	= PU_WHITE_BALANCE_COMPONENT_CONTROL,
-		.index		= 7,
-		.size		= 4,
-		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
+		.entity		= UVC_GUID_UVC_CAMERA,
+		.selector	= CT_PRIVACY_CONTROL,
+		.index		= 18,
+		.size		= 1,
+		.flags		= UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
 				| UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE,
 	},
 };
@@ -594,7 +720,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video,
 	if (ctrl == NULL)
 		return -EINVAL;
 
-	data = kmalloc(8, GFP_KERNEL);
+	data = kmalloc(ctrl-&gt;info-&gt;size, GFP_KERNEL);
 	if (data == NULL)
 		return -ENOMEM;
 
@@ -713,7 +839,17 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
 
 	for (i = 0; i &lt; entity-&gt;ncontrols; ++i) {
 		ctrl = &amp;entity-&gt;controls[i];
-		if (ctrl-&gt;info == NULL || !ctrl-&gt;dirty)
+		if (ctrl-&gt;info == NULL)
+			continue;
+
+		/* Reset the loaded flag for auto-update controls that were
+		 * marked as loaded in uvc_ctrl_get/uvc_ctrl_set to prevent
+		 * uvc_ctrl_get from using the cached value.
+		 */
+		if (ctrl-&gt;info-&gt;flags &amp; UVC_CONTROL_AUTO_UPDATE)
+			ctrl-&gt;loaded = 0;
+
+		if (!ctrl-&gt;dirty)
 			continue;
 
 		if (!rollback)
@@ -729,9 +865,6 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
 			       uvc_ctrl_data(ctrl, UVC_CTRL_DATA_BACKUP),
 			       ctrl-&gt;info-&gt;size);
 
-		if ((ctrl-&gt;info-&gt;flags &amp; UVC_CONTROL_GET_CUR) == 0)
-			ctrl-&gt;loaded = 0;
-
 		ctrl-&gt;dirty = 0;
 
 		if (ret &lt; 0)
@@ -789,8 +922,7 @@ int uvc_ctrl_get(struct uvc_video_device *video,
 		if (ret &lt; 0)
 			return ret;
 
-		if ((ctrl-&gt;info-&gt;flags &amp; UVC_CONTROL_AUTO_UPDATE) == 0)
-			ctrl-&gt;loaded = 1;
+		ctrl-&gt;loaded = 1;
 	}
 
 	xctrl-&gt;value = uvc_get_le_value(
@@ -841,8 +973,7 @@ int uvc_ctrl_set(struct uvc_video_device *video,
 				return ret;
 		}
 
-		if ((ctrl-&gt;info-&gt;flags &amp; UVC_CONTROL_AUTO_UPDATE) == 0)
-			ctrl-&gt;loaded = 1;
+		ctrl-&gt;loaded = 1;
 	}
 
 	if (!ctrl-&gt;dirty) {</diff>
      <filename>uvc_ctrl.c</filename>
    </modified>
    <modified>
      <diff>@@ -291,8 +291,10 @@ static int uvc_parse_format(struct uvc_device *dev,
 	struct uvc_format_desc *fmtdesc;
 	struct uvc_frame *frame;
 	const unsigned char *start = buffer;
+	unsigned char *_buffer;
 	unsigned int interval;
 	unsigned int i, n;
+	int _buflen;
 	__u8 ftype;
 
 	format-&gt;type = buffer[2];
@@ -413,12 +415,20 @@ static int uvc_parse_format(struct uvc_device *dev,
 	buflen -= buffer[0];
 	buffer += buffer[0];
 
+	/* Count the number of frame descriptors to test the bFrameIndex
+	 * field when parsing the descriptors. We can't rely on the
+	 * bNumFrameDescriptors field as some cameras don't initialize it
+	 * properly.
+	 */
+	for (_buflen = buflen, _buffer = buffer;
+	     _buflen &gt; 2 &amp;&amp; _buffer[2] == ftype;
+	     _buflen -= _buffer[0], _buffer += _buffer[0])
+		format-&gt;nframes++;
+
 	/* Parse the frame descriptors. Only uncompressed, MJPEG and frame
 	 * based formats have frame descriptors.
 	 */
 	while (buflen &gt; 2 &amp;&amp; buffer[2] == ftype) {
-		frame = &amp;format-&gt;frame[format-&gt;nframes];
-
 		if (ftype != VS_FRAME_FRAME_BASED)
 			n = buflen &gt; 25 ? buffer[25] : 0;
 		else
@@ -433,6 +443,16 @@ static int uvc_parse_format(struct uvc_device *dev,
 			return -EINVAL;
 		}
 
+		if (buffer[3] - 1 &gt;= format-&gt;nframes) {
+			uvc_trace(UVC_TRACE_DESCR, &quot;device %d videostreaming&quot;
+			       &quot;interface %d frame index %u out of range\n&quot;,
+			       dev-&gt;udev-&gt;devnum, alts-&gt;desc.bInterfaceNumber,
+			       buffer[3]);
+			return -EINVAL;
+		}
+
+		frame = &amp;format-&gt;frame[buffer[3] - 1];
+
 		frame-&gt;bFrameIndex = buffer[3];
 		frame-&gt;bmCapabilities = buffer[4];
 		frame-&gt;wWidth = le16_to_cpup((__le16 *)&amp;buffer[5]);
@@ -489,7 +509,6 @@ static int uvc_parse_format(struct uvc_device *dev,
 			10000000/frame-&gt;dwDefaultFrameInterval,
 			(100000000/frame-&gt;dwDefaultFrameInterval)%10);
 
-		format-&gt;nframes++;
 		buflen -= buffer[0];
 		buffer += buffer[0];
 	}
@@ -1848,6 +1867,15 @@ static struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_STREAM_NO_FID },
+	/* Syntek (Samsung Q310) */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x174f,
+	  .idProduct		= 0x5931,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_STREAM_NO_FID },
 	/* Asus F9SG */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -1866,6 +1894,15 @@ static struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_STREAM_NO_FID },
+	/* Lenovo Thinkpad SL500 */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x17ef,
+	  .idProduct		= 0x480b,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_STREAM_NO_FID },
 	/* Ecamm Pico iMage */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -1923,6 +1960,24 @@ static struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_PROBE_MINMAX },
+	/* Compaq Presario B1200 - Bison Electronics */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x5986,
+	  .idProduct		= 0x0104,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_PROBE_MINMAX },
+	/* Acer Travelmate 7720 - Bison Electronics */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x5986,
+	  .idProduct		= 0x0105,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_PROBE_MINMAX },
 	/* Medion Akoya Mini E1210 - Bison Electronics */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -1950,6 +2005,15 @@ static struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_PROBE_MINMAX },
+	/*  Advent 4211 - Bison Electronics */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x5986,
+	  .idProduct		= 0x0203,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_PROBE_MINMAX },
 	/* Bison Electronics */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,</diff>
      <filename>uvc_driver.c</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,7 @@
 
 #include &lt;linux/kernel.h&gt;
 #include &lt;linux/version.h&gt;
+#include &lt;linux/mm.h&gt;
 #include &lt;linux/list.h&gt;
 #include &lt;linux/module.h&gt;
 #include &lt;linux/usb.h&gt;
@@ -341,7 +342,7 @@ int uvc_dequeue_buffer(struct uvc_video_queue *queue,
 		goto done;
 	}
 
-	// Flip webcam image.
+	/* Flip webcam image. */
 	for (i = 0; i &lt; (frame-&gt;wHeight &gt;&gt; 1); i++) {
 		memcpy(&amp;swap, (char *) queue-&gt;mem + buf-&gt;buf.m.offset +
 			i * (frame-&gt;wWidth &lt;&lt; 1), (frame-&gt;wWidth &lt;&lt; 1));</diff>
      <filename>uvc_queue.c</filename>
    </modified>
    <modified>
      <diff>@@ -189,9 +189,15 @@ int uvc_status_init(struct uvc_device *dev)
 
 	uvc_input_init(dev);
 
+	dev-&gt;status = kzalloc(UVC_MAX_STATUS_SIZE, GFP_KERNEL);
+	if (dev-&gt;status == NULL)
+		return -ENOMEM;
+
 	dev-&gt;int_urb = usb_alloc_urb(0, GFP_KERNEL);
-	if (dev-&gt;int_urb == NULL)
+	if (dev-&gt;int_urb == NULL) {
+		kfree(dev-&gt;status);
 		return -ENOMEM;
+	}
 
 	pipe = usb_rcvintpipe(dev-&gt;udev, ep-&gt;desc.bEndpointAddress);
 
@@ -204,7 +210,7 @@ int uvc_status_init(struct uvc_device *dev)
 		interval = fls(interval) - 1;
 
 	usb_fill_int_urb(dev-&gt;int_urb, dev-&gt;udev, pipe,
-		dev-&gt;status, sizeof dev-&gt;status, uvc_status_complete,
+		dev-&gt;status, UVC_MAX_STATUS_SIZE, uvc_status_complete,
 		dev, interval);
 
 	return usb_submit_urb(dev-&gt;int_urb, GFP_KERNEL);
@@ -214,6 +220,7 @@ void uvc_status_cleanup(struct uvc_device *dev)
 {
 	usb_kill_urb(dev-&gt;int_urb);
 	usb_free_urb(dev-&gt;int_urb);
+	kfree(dev-&gt;status);
 	uvc_input_cleanup(dev);
 }
 </diff>
      <filename>uvc_status.c</filename>
    </modified>
    <modified>
      <diff>@@ -404,15 +404,13 @@ static int uvc_has_privileges(struct uvc_fh *handle)
 
 static int uvc_v4l2_open(struct inode *inode, struct file *file)
 {
-	struct video_device *vdev;
 	struct uvc_video_device *video;
 	struct uvc_fh *handle;
 	int ret = 0;
 
 	uvc_trace(UVC_TRACE_CALLS, &quot;uvc_v4l2_open\n&quot;);
 	mutex_lock(&amp;uvc_driver.open_mutex);
-	vdev = video_devdata(file);
-	video = video_get_drvdata(vdev);
+	video = video_drvdata(file);
 
 	if (video-&gt;dev-&gt;state &amp; UVC_DEV_DISCONNECTED) {
 		ret = -ENODEV;
@@ -444,8 +442,7 @@ done:
 
 static int uvc_v4l2_release(struct inode *inode, struct file *file)
 {
-	struct video_device *vdev = video_devdata(file);
-	struct uvc_video_device *video = video_get_drvdata(vdev);
+	struct uvc_video_device *video = video_drvdata(file);
 	struct uvc_fh *handle = (struct uvc_fh *)file-&gt;private_data;
 
 	uvc_trace(UVC_TRACE_CALLS, &quot;uvc_v4l2_release\n&quot;);
@@ -849,10 +846,6 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
 		if (ret &lt; 0)
 			return ret;
 
-		if (!(video-&gt;streaming-&gt;cur_format-&gt;flags &amp;
-		    UVC_FMT_FLAG_COMPRESSED))
-			video-&gt;queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
-
 		rb-&gt;count = ret;
 		ret = 0;
 		break;
@@ -1036,8 +1029,7 @@ static struct vm_operations_struct uvc_vm_ops = {
 
 static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
 {
-	struct video_device *vdev = video_devdata(file);
-	struct uvc_video_device *video = video_get_drvdata(vdev);
+	struct uvc_video_device *video = video_drvdata(file);
 	struct uvc_buffer *uninitialized_var(buffer);
 	struct page *page;
 	unsigned long addr, start, size;
@@ -1090,8 +1082,7 @@ done:
 
 static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
 {
-	struct video_device *vdev = video_devdata(file);
-	struct uvc_video_device *video = video_get_drvdata(vdev);
+	struct uvc_video_device *video = video_drvdata(file);
 
 	uvc_trace(UVC_TRACE_CALLS, &quot;uvc_v4l2_poll\n&quot;);
 </diff>
      <filename>uvc_v4l2.c</filename>
    </modified>
    <modified>
      <diff>@@ -662,7 +662,7 @@ static int uvc_init_video_isoc(struct uvc_video_device *video,
 	if (size &gt; UVC_MAX_FRAME_SIZE)
 		return -EINVAL;
 
-	npackets = (size + psize - 1) / psize;
+	npackets = DIV_ROUND_UP(size, psize);
 	if (npackets &gt; UVC_MAX_ISO_PACKETS)
 		npackets = UVC_MAX_ISO_PACKETS;
 
@@ -977,6 +977,11 @@ int uvc_video_enable(struct uvc_video_device *video, int enable)
 		return 0;
 	}
 
+	if (video-&gt;streaming-&gt;cur_format-&gt;flags &amp; UVC_FMT_FLAG_COMPRESSED)
+		video-&gt;queue.flags &amp;= ~UVC_QUEUE_DROP_INCOMPLETE;
+	else
+		video-&gt;queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
+
 	if ((ret = uvc_queue_enable(&amp;video-&gt;queue, 1)) &lt; 0)
 		return ret;
 </diff>
      <filename>uvc_video.c</filename>
    </modified>
    <modified>
      <diff>@@ -304,6 +304,8 @@ struct uvc_xu_control {
 #define UVC_MAX_FRAME_SIZE	(16*1024*1024)
 /* Maximum number of video buffers. */
 #define UVC_MAX_VIDEO_BUFFERS	32
+/* Maximum status buffer size in bytes of interrupt URB. */
+#define UVC_MAX_STATUS_SIZE	16
 
 #define UVC_CTRL_CONTROL_TIMEOUT	300
 #define UVC_CTRL_STREAMING_TIMEOUT	1000
@@ -635,7 +637,7 @@ struct uvc_device {
 	/* Status Interrupt Endpoint */
 	struct usb_host_endpoint *int_ep;
 	struct urb *int_urb;
-	__u8 status[16];
+	__u8 *status;
 	struct input_dev *input;
 
 	/* Video Streaming interfaces */</diff>
      <filename>uvcvideo.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b8f85e01521f255939eb37d019ea9fe569ddb015</id>
    </parent>
  </parents>
  <author>
    <name>Derek Bruce</name>
    <email>dbruce@gmail.com</email>
  </author>
  <url>http://github.com/dfu/linux-uvc_flip/commit/d79e05cb5e801119e325134ceb9e9e79c4ce41e1</url>
  <id>d79e05cb5e801119e325134ceb9e9e79c4ce41e1</id>
  <committed-date>2008-10-22T13:45:19-07:00</committed-date>
  <authored-date>2008-10-22T13:45:19-07:00</authored-date>
  <message>Updated to SVN-261 of linux-uvc.</message>
  <tree>e5fd840e468b53464fe878588b191032fbc5a107</tree>
  <committer>
    <name>Derek Bruce</name>
    <email>dbruce@gmail.com</email>
  </committer>
</commit>
