From patchwork Mon Jun 26 11:04:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 780665 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wx5nc3ztYz9s65 for ; Mon, 26 Jun 2017 21:05:40 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4FDDEC21C6D; Mon, 26 Jun 2017 11:05:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3E4E1C21C2A; Mon, 26 Jun 2017 11:05:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AB1EBC21C2A; Mon, 26 Jun 2017 11:05:32 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id 55950C21BE6 for ; Mon, 26 Jun 2017 11:05:32 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3wx5nS13D7z1qtH3; Mon, 26 Jun 2017 13:05:32 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3wx5nR4fBSz3jgXy; Mon, 26 Jun 2017 13:05:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id a59wKDgMPsRZ; Mon, 26 Jun 2017 13:05:30 +0200 (CEST) X-Auth-Info: +11Q5rNScaC/ax3WrZoBhit9gx89ya+jn6CJTqJPPq0= Received: from localhost.localdomain (89-77-92-62.dynamic.chello.pl [89.77.92.62]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 26 Jun 2017 13:05:29 +0200 (CEST) From: Lukasz Majewski To: u-boot@lists.denx.de Date: Mon, 26 Jun 2017 13:04:58 +0200 Message-Id: <1498475098-17641-1-git-send-email-lukma@denx.de> X-Mailer: git-send-email 2.1.4 Cc: Marek Vasut Subject: [U-Boot] [PATCH] usb: gadget: Call g_dnl_bind_fixup() before testing g_dnl_serial length X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "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 Acked-by: Heiko Schocher Tested-by: Heiko Schocher --- 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;