ehci-mx5/6: Make board_ehci_hcd_init() optional

A custom board_ehci_hcd_init() may be unneeded, so add a weak default
implementation doing nothing.

By the way, use simple __weak from linux/compiler.h for
board_ehci_hcd_postinit() instead of weak alias with full attribute.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
This commit is contained in:
Benoît Thébaudeau 2012-11-13 09:58:35 +00:00 committed by Stefano Babic
parent 961a762838
commit f22e4fae19
2 changed files with 10 additions and 3 deletions

View File

@ -290,12 +290,14 @@ int mxc_set_usbcontrol(int port, unsigned int flags)
return ret; return ret;
} }
void __board_ehci_hcd_postinit(struct usb_ehci *ehci, int port) int __weak board_ehci_hcd_init(int port)
{ {
return 0;
} }
void board_ehci_hcd_postinit(struct usb_ehci *ehci, int port) void __weak board_ehci_hcd_postinit(struct usb_ehci *ehci, int port)
__attribute((weak, alias("__board_ehci_hcd_postinit"))); {
}
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
{ {

View File

@ -159,6 +159,11 @@ static void usbh1_oc_config(void)
__raw_writel(val, usbother_base + USB_H1_CTRL_OFFSET); __raw_writel(val, usbother_base + USB_H1_CTRL_OFFSET);
} }
int __weak board_ehci_hcd_init(int port)
{
return 0;
}
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
{ {
struct usb_ehci *ehci; struct usb_ehci *ehci;