From: Felipe Balbi Date: Wed, 22 Feb 2017 09:22:38 +0000 (+0200) Subject: usb: gadget: f_dfu: set serial number if serial# is valid X-Git-Tag: v2017.03-rc3~7^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9bf9e813584c23b677e92d8dca742ae9ef27fc94;p=u-boot usb: gadget: f_dfu: set serial number if serial# is valid With this patch, USB Command Verifier is happy with our DFU implementation on Chapter 9 tests. Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c index 81929d3e0d..dfa4359577 100644 --- a/drivers/usb/gadget/f_dfu.c +++ b/drivers/usb/gadget/f_dfu.c @@ -691,6 +691,7 @@ static int dfu_bind(struct usb_configuration *c, struct usb_function *f) { struct usb_composite_dev *cdev = c->cdev; struct f_dfu *f_dfu = func_to_dfu(f); + const char *s; int alt_num = dfu_get_alt_number(); int rv, id, i; @@ -724,6 +725,10 @@ static int dfu_bind(struct usb_configuration *c, struct usb_function *f) cdev->req->context = f_dfu; + s = getenv("serial#"); + if (s) + g_dnl_set_serialnumber((char *)s); + error: return rv; }