summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/g_dnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/g_dnl.c')
-rw-r--r--drivers/usb/gadget/g_dnl.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 4ba7c1da7c..d4bee9b03e 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -36,7 +36,7 @@
#define STRING_USBDOWN 2
/* Index of String serial */
#define STRING_SERIAL 3
-#define MAX_STRING_SERIAL 32
+#define MAX_STRING_SERIAL 256
/* Number of supported configurations */
#define CONFIGURATION_NUMBER 1
@@ -62,8 +62,8 @@ static struct usb_device_descriptor device_desc = {
.idVendor = __constant_cpu_to_le16(CONFIG_G_DNL_VENDOR_NUM),
.idProduct = __constant_cpu_to_le16(CONFIG_G_DNL_PRODUCT_NUM),
- .iProduct = STRING_PRODUCT,
- .iSerialNumber = STRING_SERIAL,
+ /* .iProduct = DYNAMIC */
+ /* .iSerialNumber = DYNAMIC */
.bNumConfigurations = 1,
};
@@ -224,12 +224,14 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
g_dnl_string_defs[1].id = id;
device_desc.iProduct = id;
- id = usb_string_id(cdev);
- if (id < 0)
- return id;
+ if (strlen(g_dnl_serial)) {
+ id = usb_string_id(cdev);
+ if (id < 0)
+ return id;
- g_dnl_string_defs[2].id = id;
- device_desc.iSerialNumber = id;
+ g_dnl_string_defs[2].id = id;
+ device_desc.iSerialNumber = id;
+ }
g_dnl_bind_fixup(&device_desc, cdev->driver->name);
ret = g_dnl_config_register(cdev);