]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
usb: musb: davinci.c: add missing unregister
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 16 Apr 2012 15:03:10 +0000 (17:03 +0200)
committerFelipe Balbi <balbi@ti.com>
Wed, 18 Apr 2012 10:50:54 +0000 (13:50 +0300)
usb_nop_xceiv_unregister is needed on failure of usb_get_transceiver, as
done in other error-handling code in the same function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/davinci.c

index 97ab975fa4424c3bcb4b6cce5368fc144aaba845..768b4b55c816a6960733f73d7e0d7b86be54697f 100644 (file)
@@ -386,7 +386,7 @@ static int davinci_musb_init(struct musb *musb)
        usb_nop_xceiv_register();
        musb->xceiv = usb_get_transceiver();
        if (!musb->xceiv)
-               return -ENODEV;
+               goto unregister;
 
        musb->mregs += DAVINCI_BASE_OFFSET;
 
@@ -444,6 +444,7 @@ static int davinci_musb_init(struct musb *musb)
 
 fail:
        usb_put_transceiver(musb->xceiv);
+unregister:
        usb_nop_xceiv_unregister();
        return -ENODEV;
 }