summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-05-05 16:45:20 -0700
committerMax Krummenacher <max.krummenacher@toradex.com>2016-06-22 14:36:39 +0200
commitc30a33976d7f01dc86d920774d6d6315e77ff7cd (patch)
treec5a30c27fe667461800f8d620d32ee587df35013
parentbb1835aed9f24b6edbc9d04980e2b27578c6129e (diff)
usb: ehci-mx7: allow board_ehci_hcd_init to fail
There could be runtime determined board specific reason why a EHCI initialization fails (e.g. ENODEV if a Port is not available). In this case, properly return the error code. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--drivers/usb/host/ehci-mx7.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-mx7.c b/drivers/usb/host/ehci-mx7.c
index 7429d62adc..baab306481 100644
--- a/drivers/usb/host/ehci-mx7.c
+++ b/drivers/usb/host/ehci-mx7.c
@@ -70,6 +70,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
{
struct usb_ehci *ehci = (struct usb_ehci *)(USB_BASE_ADDR +
(0x10000 * index));
+ int rc;
if (index > 3)
return -EINVAL;
@@ -77,7 +78,9 @@ int ehci_hcd_init(int index, enum usb_init_type init,
mdelay(1);
/* Do board specific initialization */
- board_ehci_hcd_init(index);
+ rc = board_ehci_hcd_init(index);
+ if (rc)
+ return rc;
usb_oc_config(index);