usb: gadget: update os_desc_config when add config

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>
This commit is contained in:
Jun Li 2021-01-25 21:43:53 +08:00 committed by Marek Vasut
parent 4e643671f5
commit 42a594de14

View 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)