USB: gadget: android: Fix problem switching vendor IDs
authorMike Lockwood <lockwood@android.com>
Mon, 14 Feb 2011 18:32:05 +0000 (13:32 -0500)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:07:20 +0000 (12:07 -0800)
We need to update the vendor ID in the composite driver as well

Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/android.c

index e49ef2c..eb6af6d 100644 (file)
@@ -343,6 +343,7 @@ static int android_bind(struct usb_composite_dev *cdev)
        dev->cdev = cdev;
        device_desc.idVendor = __constant_cpu_to_le16(get_vendor_id(dev));
        device_desc.idProduct = __constant_cpu_to_le16(get_product_id(dev));
+       cdev->desc.idVendor = device_desc.idVendor;
        cdev->desc.idProduct = device_desc.idProduct;
 
        return 0;
@@ -434,8 +435,10 @@ void android_enable_function(struct usb_function *f, int enable)
 
                device_desc.idVendor = __constant_cpu_to_le16(get_vendor_id(dev));
                device_desc.idProduct = __constant_cpu_to_le16(get_product_id(dev));
-               if (dev->cdev)
+               if (dev->cdev) {
+                       dev->cdev->desc.idVendor = device_desc.idVendor;
                        dev->cdev->desc.idProduct = device_desc.idProduct;
+               }
                usb_composite_force_reset(dev->cdev);
        }
 }