X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fehci-hcd.c;h=13aa70d606614a61eb0db6fd04a4651786958671;hb=5cf618ee60a752d058a767372ca1ecb8d9c09b16;hp=598f444504b7e82fe5eb13cc9d50c4bc382e1ebe;hpb=3f9f8a5b83f8aec40c9f4ee496046a695e333c45;p=u-boot diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 598f444504..13aa70d606 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -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; }