usb: ehci-mx6: 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.
While at it, that function (board_ehci_hcd_init) has actually two
documentation blocks... Use the correct function name for the
documentation block of board_usb_phy_mode.

Signed-off-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
Stefan Agner 2016-05-05 16:59:12 -07:00 committed by Marek Vasut
parent bbca7108db
commit 79d867c2e6
1 changed files with 5 additions and 2 deletions

View File

@ -254,7 +254,7 @@ static void usb_oc_config(int index)
} }
/** /**
* board_ehci_hcd_init - override usb phy mode * board_usb_phy_mode - override usb phy mode
* @port: usb host/otg port * @port: usb host/otg port
* *
* Target board specific, override usb_phy_mode. * Target board specific, override usb_phy_mode.
@ -310,6 +310,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
#endif #endif
struct usb_ehci *ehci = (struct usb_ehci *)(USB_BASE_ADDR + struct usb_ehci *ehci = (struct usb_ehci *)(USB_BASE_ADDR +
(controller_spacing * index)); (controller_spacing * index));
int ret;
if (index > 3) if (index > 3)
return -EINVAL; return -EINVAL;
@ -317,7 +318,9 @@ int ehci_hcd_init(int index, enum usb_init_type init,
mdelay(1); mdelay(1);
/* Do board specific initialization */ /* Do board specific initialization */
board_ehci_hcd_init(index); ret = board_ehci_hcd_init(index);
if (ret)
return ret;
usb_power_config(index); usb_power_config(index);
usb_oc_config(index); usb_oc_config(index);