summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-05-05 08:35:00 +0200
committerIngo Molnar <mingo@kernel.org>2016-05-05 08:35:00 +0200
commit1fb48f8e54e5ed4d3d8599ba7e83f1f60530c81c (patch)
tree6b8c1ccdd461e211f72c674d183f5129f5fe4a5b /drivers/usb/dwc3/gadget.c
parentx86/asm/entry/32: Simplify pushes of zeroed pt_regs->REGs (diff)
parentLinux 4.6-rc6 (diff)
downloadlinux-1fb48f8e54e5ed4d3d8599ba7e83f1f60530c81c.tar.xz
linux-1fb48f8e54e5ed4d3d8599ba7e83f1f60530c81c.zip
Merge tag 'v4.6-rc6' into x86/asm, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index d54a028cdfeb..8e4a1b195e9b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2936,6 +2936,9 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
int dwc3_gadget_suspend(struct dwc3 *dwc)
{
+ if (!dwc->gadget_driver)
+ return 0;
+
if (dwc->pullups_connected) {
dwc3_gadget_disable_irq(dwc);
dwc3_gadget_run_stop(dwc, true, true);
@@ -2954,6 +2957,9 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
struct dwc3_ep *dep;
int ret;
+ if (!dwc->gadget_driver)
+ return 0;
+
/* Start with SuperSpeed Default */
dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);