diff mbox

[U-Boot,4/5] dm: usb: Add more debugging in ehci-hcd.c

Message ID 1429378427-32319-5-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass April 18, 2015, 5:33 p.m. UTC
Add some debugging to detect init failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/usb/host/ehci-hcd.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Comments

Marek Vasut April 21, 2015, 10:19 a.m. UTC | #1
On Saturday, April 18, 2015 at 07:33:46 PM, Simon Glass wrote:
> Add some debugging to detect init failure.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bd9861d..066e7c5 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1140,26 +1140,34 @@  int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
 	ctrl->ops = default_ehci_ops;
 
 	rc = ehci_hcd_init(index, init, &ctrl->hccr, &ctrl->hcor);
-	if (rc)
+	if (rc) {
+		debug("%s: ehci_hcd_init failed, rc=%d\n", __func__, rc);
 		return rc;
+	}
 	if (init == USB_INIT_DEVICE)
 		goto done;
 
 	/* EHCI spec section 4.1 */
-	if (ehci_reset(ctrl))
+	if (ehci_reset(ctrl)) {
+		debug("%s: ehci_reset failed\n", __func__);
 		return -1;
+	}
 
 #if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
 	rc = ehci_hcd_init(index, init, &ctrl->hccr, &ctrl->hcor);
-	if (rc)
+	if (rc) {
+		debug("%s: ehci_hcd_init2 failed, rc=%d\n", __func__, rc);
 		return rc;
+	}
 #endif
 #ifdef CONFIG_USB_EHCI_FARADAY
 	tweaks |= EHCI_TWEAK_NO_INIT_CF;
 #endif
 	rc = ehci_common_init(ctrl, tweaks);
-	if (rc)
+	if (rc) {
+		debug("%s: ehci_common_init failed, rc=%d\n", __func__, rc);
 		return rc;
+	}
 
 	ctrl->rootdev = 0;
 done: