[PATCH V2 10/17] usb: gadget: update os_desc_config when add config

peng.fan at nxp.com peng.fan at nxp.com
Mon Jan 25 14:43:53 CET 2021


From: Jun Li <jun.li at 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 at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 drivers/usb/gadget/composite.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index e6fdefd3d0..404da12754 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)
-- 
2.28.0



More information about the U-Boot mailing list