From: Greg Kroah-Hartman Date: Thu, 16 Dec 2010 23:52:30 +0000 (-0800) Subject: Revert "USB: gadget: Allow function access to device ID data during bind()" X-Git-Tag: v2.6.36.3~44 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ccb29760fe7e70ec464be1f1d5518e8a12a34486;p=karo-tx-linux.git Revert "USB: gadget: Allow function access to device ID data during bind()" commit dbb442b85a1d82f91cfe0524c4f9b3a5196a10ca upstream. This reverts commit 1ab83238740ff1e1773d5c13ecac43c60cf4aec4. Turns out this doesn't allow for the device ids to be overridden properly, so we need to revert the thing. Reported-by: Jef Driesen Cc: Robert Lukassen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 9a98c38ced8f..67746b19ac54 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1083,14 +1083,6 @@ static int composite_bind(struct usb_gadget *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 * serial number), register function drivers, potentially update * power state and consumption, etc @@ -1102,6 +1094,14 @@ static int composite_bind(struct usb_gadget *gadget) cdev->desc = *composite->dev; 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); + /* strings can't be assigned before bind() allocates the * releavnt identifiers */