]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: update os_desc_config when add config
authorJun Li <jun.li@nxp.com>
Mon, 25 Jan 2021 13:43:53 +0000 (21:43 +0800)
committerMarek Vasut <marex@denx.de>
Sun, 31 Jan 2021 13:08:56 +0000 (14:08 +0100)
Always use the new added config for os_desc_config to fix cdev->
os_desc_config may miss set in case we restart usb gadget driver.

Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/usb/gadget/composite.c

index e6fdefd3d0d2e8306f7538a3e536cccf011f76e3..404da12754c7dcfde67629c9dc4b19faeab087df 100644 (file)
@@ -512,8 +512,8 @@ int usb_add_config(struct usb_composite_dev *cdev,
 
        usb_ep_autoconfig_reset(cdev->gadget);
 
-       if (os_desc_config)
-               cdev->os_desc_config = os_desc_config;
+       os_desc_config = config;
+       cdev->os_desc_config = os_desc_config;
 
 done:
        if (status)