提交 dbb442b8 编写于 作者: G Greg Kroah-Hartman

Revert "USB: gadget: Allow function access to device ID data during bind()"

This reverts commit 1ab83238.

Turns out this doesn't allow for the device ids to be overridden
properly, so we need to revert the thing.
Reported-by: NJef Driesen <jefdriesen@telenet.be>
Cc: Robert Lukassen <Robert.Lukassen@tomtom.com>
Cc: stable <stable@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 ecc1624a
...@@ -1107,14 +1107,6 @@ static int composite_bind(struct usb_gadget *gadget) ...@@ -1107,14 +1107,6 @@ static int composite_bind(struct usb_gadget *gadget)
*/ */
usb_ep_autoconfig_reset(cdev->gadget); usb_ep_autoconfig_reset(cdev->gadget);
/* standardized runtime overrides for device ID data */
if (idVendor)
cdev->desc.idVendor = cpu_to_le16(idVendor);
if (idProduct)
cdev->desc.idProduct = cpu_to_le16(idProduct);
if (bcdDevice)
cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
/* composite gadget needs to assign strings for whole device (like /* composite gadget needs to assign strings for whole device (like
* serial number), register function drivers, potentially update * serial number), register function drivers, potentially update
* power state and consumption, etc * power state and consumption, etc
...@@ -1126,6 +1118,14 @@ static int composite_bind(struct usb_gadget *gadget) ...@@ -1126,6 +1118,14 @@ static int composite_bind(struct usb_gadget *gadget)
cdev->desc = *composite->dev; cdev->desc = *composite->dev;
cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
/* standardized runtime overrides for device ID data */
if (idVendor)
cdev->desc.idVendor = cpu_to_le16(idVendor);
if (idProduct)
cdev->desc.idProduct = cpu_to_le16(idProduct);
if (bcdDevice)
cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
/* stirng overrides */ /* stirng overrides */
if (iManufacturer || !cdev->desc.iManufacturer) { if (iManufacturer || !cdev->desc.iManufacturer) {
if (!iManufacturer && !composite->iManufacturer && if (!iManufacturer && !composite->iManufacturer &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册