[U-Boot] [PATCH 2/2] usb: gadget: f_dfu: set serial number if serial# is valid

Felipe Balbi felipe.balbi at linux.intel.com
Wed Feb 22 09:22:38 UTC 2017


With this patch, USB Command Verifier is happy with our DFU
implementation on Chapter 9 tests.

Signed-off-by: Felipe Balbi <felipe.balbi at linux.intel.com>
---
 drivers/usb/gadget/f_dfu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 64cdfa7c98ec..52a6a79ceefc 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;
 }
-- 
2.11.0.295.gd7dffce1ce



More information about the U-Boot mailing list