regmap: clean up regmap allocation
[oweals/u-boot.git] / drivers / usb / gadget / f_dfu.c
index 81929d3e0daf564f45d912c94e827befe1d60fdc..30ece524a8e142eb1fd8662eb36bdea0b1d5b842 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * f_dfu.c -- Device Firmware Update USB function
  *
@@ -11,8 +12,6 @@
  *
  * based on existing SAM7DFU code from OpenPCD:
  * (C) Copyright 2006 by Harald Welte <hwelte at hmw-consulting.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <errno.h>
@@ -691,6 +690,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 +724,10 @@ static int dfu_bind(struct usb_configuration *c, struct usb_function *f)
 
        cdev->req->context = f_dfu;
 
+       s = env_get("serial#");
+       if (s)
+               g_dnl_set_serialnumber((char *)s);
+
 error:
        return rv;
 }