aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/composite.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 16b353fa160a..8d81a5ccfa03 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -34,27 +34,27 @@
34 */ 34 */
35 35
36static ushort idVendor; 36static ushort idVendor;
37module_param(idVendor, ushort, 0644); 37module_param(idVendor, ushort, S_IRUGO);
38MODULE_PARM_DESC(idVendor, "USB Vendor ID"); 38MODULE_PARM_DESC(idVendor, "USB Vendor ID");
39 39
40static ushort idProduct; 40static ushort idProduct;
41module_param(idProduct, ushort, 0644); 41module_param(idProduct, ushort, S_IRUGO);
42MODULE_PARM_DESC(idProduct, "USB Product ID"); 42MODULE_PARM_DESC(idProduct, "USB Product ID");
43 43
44static ushort bcdDevice; 44static ushort bcdDevice;
45module_param(bcdDevice, ushort, 0644); 45module_param(bcdDevice, ushort, S_IRUGO);
46MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); 46MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
47 47
48static char *iManufacturer; 48static char *iManufacturer;
49module_param(iManufacturer, charp, 0644); 49module_param(iManufacturer, charp, S_IRUGO);
50MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); 50MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
51 51
52static char *iProduct; 52static char *iProduct;
53module_param(iProduct, charp, 0644); 53module_param(iProduct, charp, S_IRUGO);
54MODULE_PARM_DESC(iProduct, "USB Product string"); 54MODULE_PARM_DESC(iProduct, "USB Product string");
55 55
56static char *iSerialNumber; 56static char *iSerialNumber;
57module_param(iSerialNumber, charp, 0644); 57module_param(iSerialNumber, charp, S_IRUGO);
58MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); 58MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
59 59
60static char composite_manufacturer[50]; 60static char composite_manufacturer[50];
@@ -1478,16 +1478,12 @@ static int composite_bind(struct usb_gadget *gadget,
1478 /* standardized runtime overrides for device ID data */ 1478 /* standardized runtime overrides for device ID data */
1479 if (idVendor) 1479 if (idVendor)
1480 cdev->desc.idVendor = cpu_to_le16(idVendor); 1480 cdev->desc.idVendor = cpu_to_le16(idVendor);
1481 else 1481
1482 idVendor = le16_to_cpu(cdev->desc.idVendor);
1483 if (idProduct) 1482 if (idProduct)
1484 cdev->desc.idProduct = cpu_to_le16(idProduct); 1483 cdev->desc.idProduct = cpu_to_le16(idProduct);
1485 else 1484
1486 idProduct = le16_to_cpu(cdev->desc.idProduct);
1487 if (bcdDevice) 1485 if (bcdDevice)
1488 cdev->desc.bcdDevice = cpu_to_le16(bcdDevice); 1486 cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
1489 else
1490 bcdDevice = le16_to_cpu(cdev->desc.bcdDevice);
1491 1487
1492 /* string overrides */ 1488 /* string overrides */
1493 if (iManufacturer || !cdev->desc.iManufacturer) { 1489 if (iManufacturer || !cdev->desc.iManufacturer) {