mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
usb: dwc3: core: do gadget exit when drd init fails during probe
If it fails to do dwc3_drd_init() during probe, call the dwc3_gadget_exit() to release the gadget resource when the flag dwc->en_runtime is enabled. Signed-off-by: William Wu <william.wu@rock-chips.com> Change-Id: I12903841db4d83a7811b7e05d0a950932b4d3085
This commit is contained in:
@@ -1308,6 +1308,9 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
||||
}
|
||||
ret = dwc3_drd_init(dwc);
|
||||
if (ret) {
|
||||
if (dwc->en_runtime)
|
||||
dwc3_gadget_exit(dwc);
|
||||
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(dev, "failed to initialize dual-role\n");
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user