diff mbox series

[09/16] usb: gadget: update os_desc_config when add config

Message ID 20200916132537.8313-10-peng.fan@nxp.com
State New
Delegated to: Lukasz Majewski
Headers show
Series usb: gadget: update | expand

Commit Message

Peng Fan Sept. 16, 2020, 1:25 p.m. UTC
From: Jun Li <jun.li@nxp.com>

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 071b4b4a6f..b453055838 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -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)