From 82b3862531803215187023df9d1d10f8f98abb4f Mon Sep 17 00:00:00 2001 From: Elson Roy Serrao Date: Fri, 6 Mar 2020 13:01:55 -0800 Subject: [PATCH] usb: dwc3: gadget: update the return value of pullup function When the controller halt fails we issue a core soft reset. But we do not update the return value based on the soft reset status. This can result in sending incorrect return value to UDC core even though soft reset was successful and will result in aborting the function disconnect callbacks. Fix this by updating the return value to reflect the correct status. Change-Id: I67965824c3ca3ed09da29369d707529a33c3d450 Signed-off-by: Elson Roy Serrao --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 1a7e92546e14..84c65c747a46 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2176,7 +2176,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) spin_unlock_irqrestore(&dwc->lock, flags); if (!is_on && ret == -ETIMEDOUT) { dev_err(dwc->dev, "%s: Core soft reset...\n", __func__); - dwc3_device_core_soft_reset(dwc); + ret = dwc3_device_core_soft_reset(dwc); } enable_irq(dwc->irq);