From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Tue, 13 Nov 2012 20:58:35 +0100 (CET) Subject: [U-Boot] [PATCH v3 13/13] ehci-mx5/6: Make board_ehci_hcd_init() optional In-Reply-To: <288431028.1238905.1352836530889.JavaMail.root@advansee.com> Message-ID: <201536162.1238977.1352836715937.JavaMail.root@advansee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Cc: Marek Vasut Cc: Stefano Babic --- Changes for v2: - Use simple __weak from linux/compiler.h instead of __attribute__. - Also use __weak instead of __attribute__ for board_ehci_hcd_postinit(). - Extend to ehci-mx6.c. Changes for v3: None. .../drivers/usb/host/ehci-mx5.c | 8 +++++--- .../drivers/usb/host/ehci-mx6.c | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git u-boot-usb-76454b2.orig/drivers/usb/host/ehci-mx5.c u-boot-usb-76454b2/drivers/usb/host/ehci-mx5.c index 7e60c3c..adbed5c 100644 --- u-boot-usb-76454b2.orig/drivers/usb/host/ehci-mx5.c +++ u-boot-usb-76454b2/drivers/usb/host/ehci-mx5.c @@ -290,12 +290,14 @@ int mxc_set_usbcontrol(int port, unsigned int flags) 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) - __attribute((weak, alias("__board_ehci_hcd_postinit"))); +void __weak board_ehci_hcd_postinit(struct usb_ehci *ehci, int port) +{ +} int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { diff --git u-boot-usb-76454b2.orig/drivers/usb/host/ehci-mx6.c u-boot-usb-76454b2/drivers/usb/host/ehci-mx6.c index 9ce25da..1b20e41 100644 --- u-boot-usb-76454b2.orig/drivers/usb/host/ehci-mx6.c +++ u-boot-usb-76454b2/drivers/usb/host/ehci-mx6.c @@ -159,6 +159,11 @@ static void usbh1_oc_config(void) __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) { struct usb_ehci *ehci;