USB: gadget: android: Fix problem switching vendor IDs

We need to update the vendor ID in the composite driver as well

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2011-02-14 13:32:05 -05:00
committed by Colin Cross
parent ae4cd3a4cf
commit 1adbbfbe99

View 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);
}
}