]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/usb/musb-new/musb_core.c
musb: Allow musb_platform_enable to return an error code
[karo-tx-uboot.git] / drivers / usb / musb-new / musb_core.c
index 242cc30b1c2d07e4d81d8213a8352b03450208c3..f530af4fb73c4e5cb41f84e4b15e1ae6ec0dee90 100644 (file)
@@ -926,10 +926,17 @@ b_host:
 /*
 * Program the HDRC to start (enable interrupts, dma, etc.).
 */
+#ifndef __UBOOT__
 void musb_start(struct musb *musb)
+#else
+int musb_start(struct musb *musb)
+#endif
 {
        void __iomem    *regs = musb->mregs;
        u8              devctl = musb_readb(regs, MUSB_DEVCTL);
+#ifdef __UBOOT__
+       int ret;
+#endif
 
        dev_dbg(musb->controller, "<== devctl %02x\n", devctl);
 
@@ -972,8 +979,21 @@ void musb_start(struct musb *musb)
                if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
                        musb->is_active = 1;
        }
+
+#ifndef __UBOOT__
        musb_platform_enable(musb);
+#else
+       ret = musb_platform_enable(musb);
+       if (ret) {
+               musb->is_active = 0;
+               return ret;
+       }
+#endif
        musb_writeb(regs, MUSB_DEVCTL, devctl);
+
+#ifdef __UBOOT__
+       return 0;
+#endif
 }