提交 e21de10c 编写于 作者: G Grazvydas Ignotas 提交者: Felipe Balbi

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: NGrazvydas Ignotas <notasas@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 e5615112
...@@ -1934,6 +1934,7 @@ static int musb_gadget_stop(struct usb_gadget *g, ...@@ -1934,6 +1934,7 @@ static int musb_gadget_stop(struct usb_gadget *g,
dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); dev_dbg(musb->controller, "unregistering driver %s\n", driver->function);
musb->is_active = 0; musb->is_active = 0;
musb->gadget_driver = NULL;
musb_platform_try_idle(musb, 0); musb_platform_try_idle(musb, 0);
spin_unlock_irqrestore(&musb->lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册