提交 c740d0d8 编写于 作者: A Ajay Kumar Gupta 提交者: Greg Kroah-Hartman

USB: musb: fix put_device() call sequence

Invoke put_device(musb->xceiv->dev) before musb_platform_exit()as
xceiv is getting unregistered in musb_platform_exit().

Fixes put_device() panic when module insert/removal is performed
multiple times.
Signed-off-by: NAjay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 db8be50c
......@@ -1850,6 +1850,10 @@ static void musb_free(struct musb *musb)
dma_controller_destroy(c);
}
#ifdef CONFIG_USB_MUSB_OTG
put_device(musb->xceiv->dev);
#endif
musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
musb_platform_exit(musb);
musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
......@@ -1859,10 +1863,6 @@ static void musb_free(struct musb *musb)
clk_put(musb->clock);
}
#ifdef CONFIG_USB_MUSB_OTG
put_device(musb->xceiv->dev);
#endif
#ifdef CONFIG_USB_MUSB_HDRC_HCD
usb_put_hcd(musb_to_hcd(musb));
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册