Commit c740d0d8 authored by Ajay Kumar Gupta's avatar Ajay Kumar Gupta Committed by 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: default avatarAjay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent db8be50c
...@@ -1850,6 +1850,10 @@ static void musb_free(struct musb *musb) ...@@ -1850,6 +1850,10 @@ static void musb_free(struct musb *musb)
dma_controller_destroy(c); dma_controller_destroy(c);
} }
#ifdef CONFIG_USB_MUSB_OTG
put_device(musb->xceiv->dev);
#endif
musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
musb_platform_exit(musb); musb_platform_exit(musb);
musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
...@@ -1859,10 +1863,6 @@ static void musb_free(struct musb *musb) ...@@ -1859,10 +1863,6 @@ static void musb_free(struct musb *musb)
clk_put(musb->clock); clk_put(musb->clock);
} }
#ifdef CONFIG_USB_MUSB_OTG
put_device(musb->xceiv->dev);
#endif
#ifdef CONFIG_USB_MUSB_HDRC_HCD #ifdef CONFIG_USB_MUSB_HDRC_HCD
usb_put_hcd(musb_to_hcd(musb)); usb_put_hcd(musb_to_hcd(musb));
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment