Skip to content
Snippets Groups Projects
Commit 2a0583e3 authored by Lukasz Majewski's avatar Lukasz Majewski Committed by Tom Rini
Browse files

usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length


After the commit SHA1: 842778a0 - 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: default avatarLukasz Majewski <lukma@denx.de>
Acked-by: default avatarHeiko Schocher <hs@denx.de>
Tested-by: default avatarHeiko Schocher <hs@denx.de>
parent de820365
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment