]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
usb: gadget: fastboot: Set the Serial Number for Fastboot Gadget
authorDileep Katta <dileep.katta@linaro.org>
Fri, 13 Feb 2015 06:33:43 +0000 (14:33 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:05:52 +0000 (14:05 +0200)
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>
drivers/usb/gadget/f_fastboot.c

index fd9fc8af6ec153347b5491b23f955d69cfea45b8..751ec9e010795079a0d8c601026b0c7071f7a2fa 100644 (file)
@@ -137,6 +137,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
        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);
@@ -162,6 +163,10 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
 
        hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress;
 
+       s = getenv("serial#");
+       if (s)
+               g_dnl_set_serialnumber((char *)s);
+
        return 0;
 }