diff options
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r-- | drivers/usb/gadget/composite.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7b5cc16e4a0b..8572dad5ecbb 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
@@ -1047,9 +1047,9 @@ composite_unbind(struct usb_gadget *gadget) | |||
1047 | kfree(cdev->req->buf); | 1047 | kfree(cdev->req->buf); |
1048 | usb_ep_free_request(gadget->ep0, cdev->req); | 1048 | usb_ep_free_request(gadget->ep0, cdev->req); |
1049 | } | 1049 | } |
1050 | device_remove_file(&gadget->dev, &dev_attr_suspended); | ||
1050 | kfree(cdev); | 1051 | kfree(cdev); |
1051 | set_gadget_data(gadget, NULL); | 1052 | set_gadget_data(gadget, NULL); |
1052 | device_remove_file(&gadget->dev, &dev_attr_suspended); | ||
1053 | composite = NULL; | 1053 | composite = NULL; |
1054 | } | 1054 | } |
1055 | 1055 | ||
@@ -1107,14 +1107,6 @@ static int composite_bind(struct usb_gadget *gadget) | |||
1107 | */ | 1107 | */ |
1108 | usb_ep_autoconfig_reset(cdev->gadget); | 1108 | usb_ep_autoconfig_reset(cdev->gadget); |
1109 | 1109 | ||
1110 | /* standardized runtime overrides for device ID data */ | ||
1111 | if (idVendor) | ||
1112 | cdev->desc.idVendor = cpu_to_le16(idVendor); | ||
1113 | if (idProduct) | ||
1114 | cdev->desc.idProduct = cpu_to_le16(idProduct); | ||
1115 | if (bcdDevice) | ||
1116 | cdev->desc.bcdDevice = cpu_to_le16(bcdDevice); | ||
1117 | |||
1118 | /* composite gadget needs to assign strings for whole device (like | 1110 | /* composite gadget needs to assign strings for whole device (like |
1119 | * serial number), register function drivers, potentially update | 1111 | * serial number), register function drivers, potentially update |
1120 | * power state and consumption, etc | 1112 | * power state and consumption, etc |
@@ -1126,6 +1118,14 @@ static int composite_bind(struct usb_gadget *gadget) | |||
1126 | cdev->desc = *composite->dev; | 1118 | cdev->desc = *composite->dev; |
1127 | cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; | 1119 | cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; |
1128 | 1120 | ||
1121 | /* standardized runtime overrides for device ID data */ | ||
1122 | if (idVendor) | ||
1123 | cdev->desc.idVendor = cpu_to_le16(idVendor); | ||
1124 | if (idProduct) | ||
1125 | cdev->desc.idProduct = cpu_to_le16(idProduct); | ||
1126 | if (bcdDevice) | ||
1127 | cdev->desc.bcdDevice = cpu_to_le16(bcdDevice); | ||
1128 | |||
1129 | /* stirng overrides */ | 1129 | /* stirng overrides */ |
1130 | if (iManufacturer || !cdev->desc.iManufacturer) { | 1130 | if (iManufacturer || !cdev->desc.iManufacturer) { |
1131 | if (!iManufacturer && !composite->iManufacturer && | 1131 | if (!iManufacturer && !composite->iManufacturer && |