From 86de48953653777fd6f918f5c0f2107bb873eae3 Mon Sep 17 00:00:00 2001 From: Gregory Herrero Date: Tue, 29 Sep 2015 12:08:21 +0200 Subject: [PATCH] usb: dwc2: gadget: abort core init if core_reset fails No point of continue with initialization if core is not in a sane state. Signed-off-by: Gregory Herrero Signed-off-by: Mian Yousaf Kaukab Tested-by: Robert Baldyga Tested-by: Dinh Nguyen Tested-by: John Youn Acked-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc2/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 1a216c51bbe4..af4f0c165d05 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2287,7 +2287,8 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, u32 val; if (!is_usb_reset) - dwc2_hsotg_corereset(hsotg); + if (dwc2_hsotg_corereset(hsotg)) + return; /* * we must now enable ep0 ready for host detection and then -- 2.39.5