summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_gadget.c
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2013-03-10 01:49:14 +0100
committerFelipe Balbi <balbi@ti.com>2013-03-22 07:41:28 +0100
commite21de10cd8b1338200d96038aa66fb966fcf6ed0 (patch)
treea254fc3d77f6bdb8924e1dcbdc4f500ee684101e /drivers/usb/musb/musb_gadget.c
parentusb: musb: core: honour initial transceiver state (diff)
downloadlinux-e21de10cd8b1338200d96038aa66fb966fcf6ed0.tar.xz
linux-e21de10cd8b1338200d96038aa66fb966fcf6ed0.zip
usb: musb: gadget: clear gadget_driver when gadget is stopped
Some musb glue drivers use gadget_driver pointer to know if any gadget drivers are loaded at some moment and base further decisions on it, like to do runtime suspend/resume or not. Right now the pointer is left alone on stop and OMAP musb glue later does wrong runtime_pm decisions because of it. Clear the gadget_driver pointer on remove, it's invalid after stop anyway. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r--drivers/usb/musb/musb_gadget.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index e8408883ab0d..ff6ba3adf5fe 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1934,6 +1934,7 @@ static int musb_gadget_stop(struct usb_gadget *g,
dev_dbg(musb->controller, "unregistering driver %s\n", driver->function);
musb->is_active = 0;
+ musb->gadget_driver = NULL;
musb_platform_try_idle(musb, 0);
spin_unlock_irqrestore(&musb->lock, flags);