usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length
PATCH 1/1 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.
--- drivers/usb/gadget/g_dnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/g_dnl.c +2 -1
@@ -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;
Signature · 1 line
2.1.4
PATCH 1/1 usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length
Hello Lukasz,
Am 26.06.2017 um 13:04 schrieb Lukasz Majewski:
Quoted 7 lines
After the commit SHA1:
842778a091- the serial number descriptor is only visible when we have non zero length ofg_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).
Quoted 8 lines
This commit moves the
g_dnl_bind_fixup()call before theg_dnl_seriallength test.Signed-off-by Lukasz Majewski <[email protected]>Acked-by Heiko Schocher <[email protected]>--- drivers/usb/gadget/g_dnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Just Tested on the smartweb board. Works fine!
bye,
Heiko
Quoted 23 lines
drivers/usb/gadget/g_dnl.c +2
-1@@ -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;
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 7 lines · Lukasz Majewski
After the commit SHA1:
842778a091- the serial number descriptor is only visible when we have non zero length ofg_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).
Quoted 6 lines
This commit moves the
g_dnl_bind_fixup()call before theg_dnl_seriallength test.Signed-off-by Lukasz Majewski <[email protected]>Acked-by Heiko Schocher <[email protected]>Tested-by Heiko Schocher <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170629/8122d511/attachment.sig>