diff options
author | Lukasz Majewski <lukma@denx.de> | 2017-06-26 13:04:58 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-06-29 09:51:05 -0400 |
commit | 2a0583e3e886196338ef373c045d4a0e02ee8670 (patch) | |
tree | 06c5b42dc49f11e935e874b7d834978615ea7834 /drivers/usb/gadget/g_dnl.c | |
parent | de8203653f80eb77dc446dd3c67de2269ed03516 (diff) |
usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length
After the commit SHA1: 842778a091 - the serial number descriptor is only
visible when we have non zero length of g_dnl_serial.
However, on some platforms (e.g. Siemens) the serial number is set at
g_dnl_bind_fixup(), so with the current code we will always omit the
serial (since it is not set).
This commit moves the g_dnl_bind_fixup() call before the g_dnl_serial
length test.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/usb/gadget/g_dnl.c')
-rw-r--r-- | drivers/usb/gadget/g_dnl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index d4bee9b03e..0491a0eea9 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -224,6 +224,8 @@ static int g_dnl_bind(struct usb_composite_dev *cdev) g_dnl_string_defs[1].id = id; device_desc.iProduct = id; + g_dnl_bind_fixup(&device_desc, cdev->driver->name); + if (strlen(g_dnl_serial)) { id = usb_string_id(cdev); if (id < 0) @@ -233,7 +235,6 @@ static int g_dnl_bind(struct usb_composite_dev *cdev) device_desc.iSerialNumber = id; } - g_dnl_bind_fixup(&device_desc, cdev->driver->name); ret = g_dnl_config_register(cdev); if (ret) goto error; |