X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fusb%2Fmusb-new%2Fmusb_uboot.c;h=8662c0ff70782bb872db836516e3e12a4c6df3a7;hb=a9f47426ced2e5057930990f3cd602b8ab936f69;hp=10f6b5d1cf16a11f8a5554a512a766bb2cfa548a;hpb=1a2728ae4faf12874173de156b8a7e66cfbbeae5;p=oweals%2Fu-boot.git diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c index 10f6b5d1cf..8662c0ff70 100644 --- a/drivers/usb/musb-new/musb_uboot.c +++ b/drivers/usb/musb-new/musb_uboot.c @@ -1,9 +1,10 @@ #include +#include #include #ifdef CONFIG_ARCH_SUNXI #include #endif -#include +#include #include #include @@ -236,8 +237,10 @@ int musb_lowlevel_init(struct musb_host_data *host) if (musb_readb(mbase, MUSB_DEVCTL) & MUSB_DEVCTL_HM) break; } while (get_timer(0) < timeout); - if (get_timer(0) >= timeout) + if (get_timer(0) >= timeout) { + musb_stop(host->host); return -ENODEV; + } _musb_reset_root_port(host, NULL); host->host->is_active = 1; @@ -443,7 +446,7 @@ int musb_register(struct musb_hdrc_platform_data *plat, void *bdata, } *musbp = musb_init_controller(plat, (struct device *)bdata, ctl_regs); - if (!musbp) { + if (!*musbp) { printf("Failed to init the controller\n"); return -EIO; }