All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length
@ 2017-06-26 11:04 Lukasz Majewski
  2017-06-26 11:20 ` Heiko Schocher
  2017-06-29 17:28 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Lukasz Majewski @ 2017-06-26 11:04 UTC (permalink / raw)
  To: u-boot

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>
---
 drivers/usb/gadget/g_dnl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index d4bee9b..0491a0e 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;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length
  2017-06-26 11:04 [U-Boot] [PATCH] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length Lukasz Majewski
@ 2017-06-26 11:20 ` Heiko Schocher
  2017-06-29 17:28 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Heiko Schocher @ 2017-06-26 11:20 UTC (permalink / raw)
  To: u-boot

Hello Lukasz,

Am 26.06.2017 um 13:04 schrieb Lukasz Majewski:
> 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>
> ---
>   drivers/usb/gadget/g_dnl.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Just Tested on the smartweb board. Works fine!

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
> index d4bee9b..0491a0e 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;
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length
  2017-06-26 11:04 [U-Boot] [PATCH] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length Lukasz Majewski
  2017-06-26 11:20 ` Heiko Schocher
@ 2017-06-29 17:28 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2017-06-29 17:28 UTC (permalink / raw)
  To: u-boot

On Mon, Jun 26, 2017 at 01:04:58PM +0200, Lukasz Majewski wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-29 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 11:04 [U-Boot] [PATCH] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length Lukasz Majewski
2017-06-26 11:20 ` Heiko Schocher
2017-06-29 17:28 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.