Configure the serial number using the serial# environment variable
during the fastboot bind.
This enables "fastboot devices" to return the serial number for
the attached devices.
Signed-off-by: Dileep Katta <dileep.katta@linaro.org>
Acked-by: Steve Rae <srae@broadcom.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
        int id;
        struct usb_gadget *gadget = c->cdev->gadget;
        struct f_fastboot *f_fb = func_to_fastboot(f);
+       const char *s;
 
        /* DYNAMIC interface numbers assignments */
        id = usb_interface_id(c, f);
 
        hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress;
 
+       s = getenv("serial#");
+       if (s)
+               g_dnl_set_serialnumber((char *)s);
+
        return 0;
 }