From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/6] usb: host: xhci-omap: fix double weak board_usb_init functions
Date: Mon, 13 Feb 2017 16:52:20 +0100 [thread overview]
Message-ID: <946beae1-09c2-269c-2ebc-9f1dfa02e900@denx.de> (raw)
In-Reply-To: <1486985740-26683-1-git-send-email-uri.mashiach@compulab.co.il>
On 02/13/2017 12:35 PM, Uri Mashiach wrote:
> A weak version of the function board_usb_init is implemented in:
> common/usb.c
> drivers/usb/host/xhci-omap.c
>
> To fix the double implementations:
> * Convert the board_usb_init function in drivers/usb/host/xhci-omap.c
> normal (not weak).
> * The function board_usb_init in drivers/usb/host/xhci-omap.c calls to
> the weak function omap_xhci_board_usb_init.
> * Rename board version of the function board_usb_init to
> omap_xhci_board_usb_init.
> Done only for boards that defines CONFIG_USB_XHCI_OMAP.
>
> To achieve the same flexibility with the function board_usb_cleanup:
> * Add a normal (not weak) implementation of the function
> board_usb_cleanup in drivers/usb/host/xhci-omap.c
> * The function board_usb_cleanup in drivers/usb/host/xhci-omap.c calls
> to the weak function omap_xhci_board_usb_cleanup.
> * Rename board version of the function board_usb_cleanup to
> omap_xhci_board_usb_cleanup.
> Done only for boards that defines CONFIG_USB_XHCI_OMAP.
>
> Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
> ---
> V1 -> V2: Use __weak instead of attribute block
[...]
> +++ b/board/ti/dra7xx/evm.c
> @@ -727,7 +727,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
> .index = 1,
> };
>
> -int board_usb_init(int index, enum usb_init_type init)
> +int omap_xhci_board_usb_init(int index, enum usb_init_type init)
^
Here's a superfluous space.
> {
> enable_usb_clocks(index);
> switch (index) {
> @@ -764,7 +764,7 @@ int board_usb_init(int index, enum usb_init_type init)
> return 0;
> }
>
> -int board_usb_cleanup(int index, enum usb_init_type init)
> +int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
> {
> switch (index) {
> case 0:
> diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
> index b881b19..a1b4f2f 100644
> --- a/drivers/usb/host/xhci-omap.c
> +++ b/drivers/usb/host/xhci-omap.c
> @@ -27,12 +27,25 @@ DECLARE_GLOBAL_DATA_PTR;
>
> static struct omap_xhci omap;
>
> -__weak int __board_usb_init(int index, enum usb_init_type init)
> +__weak int omap_xhci_board_usb_init(int index, enum usb_init_type init)
> {
> return 0;
> }
> +
> int board_usb_init(int index, enum usb_init_type init)
> - __attribute__((weak, alias("__board_usb_init")));
> +{
> + return omap_xhci_board_usb_init(index, init);
> +}
> +
> +__weak int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
> +{
> + return 0;
> +}
> +
> +int board_usb_cleanup(int index, enum usb_init_type init)
> +{
> + return omap_xhci_board_usb_cleanup(index, init);
> +}
>
> static int omap_xhci_core_init(struct omap_xhci *omap)
> {
>
Otherwise:
Acked-by: Marek Vasut <marex@denx.de>
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2017-02-13 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 11:35 [U-Boot] [PATCH v2 2/6] usb: host: xhci-omap: fix double weak board_usb_init functions Uri Mashiach
2017-02-13 15:52 ` Marek Vasut [this message]
2017-02-13 17:07 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=946beae1-09c2-269c-2ebc-9f1dfa02e900@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox