]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/host/ehci-hcd.c
Merge git://git.denx.de/u-boot-arc
[u-boot] / drivers / usb / host / ehci-hcd.c
index 598f444504b7e82fe5eb13cc9d50c4bc382e1ebe..13aa70d606614a61eb0db6fd04a4651786958671 100644 (file)
@@ -210,6 +210,9 @@ static int ehci_shutdown(struct ehci_ctrl *ctrl)
                return -EINVAL;
 
        cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
+       /* If not run, directly return */
+       if (!(cmd & CMD_RUN))
+               return 0;
        cmd &= ~(CMD_PSE | CMD_ASE);
        ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
        ret = handshake(&ctrl->hcor->or_usbsts, STS_ASS | STS_PSS, 0,
@@ -1615,8 +1618,8 @@ int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
        if (ret)
                goto err;
 
-       if (ops->init_after_reset) {
-               ret = ops->init_after_reset(ctrl);
+       if (ctrl->ops.init_after_reset) {
+               ret = ctrl->ops.init_after_reset(ctrl);
                if (ret)
                        goto err;
        }