[RFC 06/19] dwc3: gadget: check returned value in suspend/resume
From: Robert Baldyga
Date: Wed Mar 18 2015 - 10:05:10 EST
Check value returned by dwc3_gadget_run_stop() in suspend/resume
functions and propagate it to next layer.
Signed-off-by: Robert Baldyga <r.baldyga@xxxxxxxxxxx>
---
drivers/usb/dwc3/gadget.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 4e73934..b0c1ab5 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2827,18 +2827,22 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
int dwc3_gadget_suspend(struct dwc3 *dwc)
{
+ int ret = 0;
+
if (dwc->pullups_connected) {
dwc3_gadget_disable_irq(dwc);
- dwc3_gadget_run_stop(dwc, true, true);
+ ret = dwc3_gadget_run_stop(dwc, true, true);
}
dwc->dcfg = dwc3_readl(dwc->regs, DWC3_DCFG);
- return 0;
+ return ret;
}
int dwc3_gadget_resume(struct dwc3 *dwc)
{
+ int ret = 0;
+
/* Start with SuperSpeed Default */
dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
@@ -2846,8 +2850,8 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
if (dwc->pullups_connected) {
dwc3_gadget_enable_irq(dwc);
- dwc3_gadget_run_stop(dwc, true, false);
+ ret = dwc3_gadget_run_stop(dwc, true, false);
}
- return 0;
+ return ret;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/