[U-Boot] [PATCH 2/6] usb: host: xhci-omap: fix double weak board_usb_init functions
Marek Vasut
marex at denx.de
Thu Feb 9 13:35:30 UTC 2017
On 02/09/2017 12:36 PM, Uri Mashiach wrote:
> Hello Marek,
Hi!
[...]
>>> diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
>>> index b881b19..ceee12a 100644
>>> --- a/drivers/usb/host/xhci-omap.c
>>> +++ b/drivers/usb/host/xhci-omap.c
>>> @@ -27,12 +27,31 @@ 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 omap_xhci_board_usb_init(int index, enum usb_init_type init)
>>> + __attribute__((weak, alias("__omap_xhci_board_usb_init")));
>>
>> You can just use __weak instead of this attribute block .
>>
>
> With the attribute block it is possible to call to
> __omap_xhci_board_usb_init from the board file.
> Do you think it's redundant?
Yes, but feel free to prove me wrong, I'm not an omap expert.
>>> 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 omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
>>> + __attribute__((weak, alias("__omap_xhci_board_usb_cleanup")));
>>> +
>>> +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)
>>> {
>>>
>>
>>
>
--
Best regards,
Marek Vasut
More information about the U-Boot
mailing list