]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/uvc/uvc_driver.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / uvc / uvc_driver.c
index 4deb04bc2a735614961b6f9a194a6cea33e5528e..7e102034d38da0726ffca86d58e1bd36fb7ca167 100644 (file)
@@ -1458,9 +1458,7 @@ static int uvc_register_video(struct uvc_device *dev)
         * unregistered before the reference is released, so we don't need to
         * get another one.
         */
-       vdev->dev = &dev->intf->dev;
-       vdev->type = 0;
-       vdev->type2 = 0;
+       vdev->parent = &dev->intf->dev;
        vdev->minor = -1;
        vdev->fops = &uvc_fops;
        vdev->release = video_device_release;
@@ -1633,13 +1631,16 @@ static void uvc_disconnect(struct usb_interface *intf)
         * reference to the uvc_device instance after uvc_v4l2_open() received
         * the pointer to the device (video_devdata) but before it got the
         * chance to increase the reference count (kref_get).
+        *
+        * Note that the reference can't be released with the lock held,
+        * otherwise a AB-BA deadlock can occur with videodev_lock that
+        * videodev acquires in videodev_open() and video_unregister_device().
         */
        mutex_lock(&uvc_driver.open_mutex);
-
        dev->state |= UVC_DEV_DISCONNECTED;
-       kref_put(&dev->kref, uvc_delete);
-
        mutex_unlock(&uvc_driver.open_mutex);
+
+       kref_put(&dev->kref, uvc_delete);
 }
 
 static int uvc_suspend(struct usb_interface *intf, pm_message_t message)
@@ -1883,7 +1884,7 @@ static struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = UVC_QUIRK_PROBE_MINMAX },
-       /* Packard Bell OEM Webcam */
+       /* Packard Bell OEM Webcam - Bison Electronics */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
          .idVendor             = 0x5986,
@@ -1892,7 +1893,7 @@ static struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = UVC_QUIRK_PROBE_MINMAX },
-       /* Acer Crystal Eye webcam */
+       /* Acer Crystal Eye webcam - Bison Electronics */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
          .idVendor             = 0x5986,
@@ -1901,7 +1902,7 @@ static struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = UVC_QUIRK_PROBE_MINMAX },
-       /* Medion Akoya Mini E1210 */
+       /* Medion Akoya Mini E1210 - Bison Electronics */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
          .idVendor             = 0x5986,
@@ -1910,7 +1911,7 @@ static struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = UVC_QUIRK_PROBE_MINMAX },
-       /* Acer OrbiCam - Unknown vendor */
+       /* Acer OrbiCam - Bison Electronics */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
          .idVendor             = 0x5986,
@@ -1919,6 +1920,24 @@ static struct usb_device_id uvc_ids[] = {
          .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,
+         .idVendor             = 0x5986,
+         .idProduct            = 0x0300,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_QUIRK_PROBE_MINMAX },
+       /* Clevo M570TU - Bison Electronics */
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+                               | USB_DEVICE_ID_MATCH_INT_INFO,
+         .idVendor             = 0x5986,
+         .idProduct            = 0x0303,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_QUIRK_PROBE_MINMAX },
        /* Generic USB Video Class */
        { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, 0) },
        {}