Skip to content

Commit

Permalink
USB: musb: fix put_device() call sequence
Browse files Browse the repository at this point in the history
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: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ajay Kumar Gupta authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent db8be50 commit c740d0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit c740d0d

Please sign in to comment.