mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: gadget: initialize serialnumber as empty string
@ 2023-10-26 12:46 Marco Felsch
  2023-10-26 12:46 ` [PATCH 2/2] scripts: get_maintainers: drop --status enforcement Marco Felsch
  2023-10-26 14:18 ` [PATCH 1/2] usb: gadget: initialize serialnumber as empty string Ahmad Fatoum
  0 siblings, 2 replies; 9+ messages in thread
From: Marco Felsch @ 2023-10-26 12:46 UTC (permalink / raw)
  To: barebox

Windows hosts do require the serial number to be set to any ascii string
to enumerate correctly. Set the serial number to "empty" to provide a
sane default which works for both hosts. Users can still override this
via the gadget.serialnumber variable.

Reported-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/usb/gadget/udc/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index b58498680ad1..dc5d1daa14bf 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1204,7 +1204,7 @@ int usb_add_gadget(struct usb_gadget *gadget)
 	gadget->productname = xstrdup(barebox_get_model());
 	dev_add_param_string(&gadget->dev, "productname", NULL, NULL,
 			     &gadget->productname, NULL);
-	gadget->serialnumber = xstrdup("");
+	gadget->serialnumber = xstrdup("empty");
 	dev_add_param_string(&gadget->dev, "serialnumber", NULL, NULL,
 			     &gadget->serialnumber, NULL);
 
-- 
2.39.2




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

end of thread, other threads:[~2023-10-26 21:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-26 12:46 [PATCH 1/2] usb: gadget: initialize serialnumber as empty string Marco Felsch
2023-10-26 12:46 ` [PATCH 2/2] scripts: get_maintainers: drop --status enforcement Marco Felsch
2023-10-26 14:21   ` Ahmad Fatoum
2023-10-26 14:27     ` Marco Felsch
2023-10-26 14:29       ` Ahmad Fatoum
2023-10-26 14:34         ` Marco Felsch
2023-10-26 21:30           ` Ahmad Fatoum
2023-10-26 14:18 ` [PATCH 1/2] usb: gadget: initialize serialnumber as empty string Ahmad Fatoum
2023-10-26 14:31   ` Marco Felsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox