Re: [PATCH v5] usb: of: add an api to get dr_mode by the phy node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

John Youn <John.Youn@xxxxxxxxxxxx> writes:
> On 11/20/2015 1:38 PM, Bin Liu wrote:
>> hi,
>> 
>> On 11/20/2015 03:35 PM, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Bin Liu <b-liu@xxxxxx> writes:
>>>>>>> +enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np);
>>>>>>>    bool of_usb_host_tpl_support(struct device_node *np);
>>>>>>>    int of_usb_update_otg_caps(struct device_node *np,
>>>>>>>    			struct usb_otg_caps *otg_caps);
>>>>>>>    #else
>>>>>>> +enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np)
>>>>>>> +{
>>>>>>> +	return USB_DR_MODE_UNKNOWN;
>>>>>>> +}
>>>>>>>    static inline bool of_usb_host_tpl_support(struct device_node *np)
>>>>>>>    {
>>>>>>>    	return false;
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Felipe,
>>>>>>
>>>>>> This commit in your testing/next causes compilation error:
>>>>>>
>>>>>> /home/johnyoun/linux/linux-usb/drivers/usb/common/common.c:143:18: error: redefinition of ‘of_usb_get_dr_mode_by_phy’
>>>>>>    enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np)
>>>>>>                     ^
>>>>>> In file included from /home/johnyoun/linux/linux-usb/drivers/usb/common/common.c:18:0:
>>>>>> /home/johnyoun/linux/linux-usb/include/linux/usb/of.h:20:18: note: previous definition of ‘of_usb_get_dr_mode_by_phy’ was here
>>>>>>    enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np)
>>>>>>                     ^
>>>>>> make[4]: *** [drivers/usb/common/common.o] Error 1
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> I'm on non-OF config.
>>>>>
>>>>> Looks like the #ifdef CONFIG_OF should encompass the new function
>>>>> in the .c file.
>>>>>
>>>>
>>>> Thanks John for pointing it out.
>>>>
>>>> Felipe,
>>>>
>>>> Do you want me to send v6 or you will fix it in your tree?
>>>
>>> send me an incremental diff which I can meld into original patch.
>>>
>> 
>> diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
>> index a11bb15..e6ec125 100644
>> --- a/drivers/usb/common/common.c
>> +++ b/drivers/usb/common/common.c
>> @@ -131,6 +131,7 @@ enum usb_dr_mode usb_get_dr_mode(struct device *dev)
>>   }
>>   EXPORT_SYMBOL_GPL(usb_get_dr_mode);
>> 
>> +#ifdef CONFIG_OF
>>   /**
>>    * of_usb_get_dr_mode_by_phy - Get dual role mode for the controller 
>> device
>>    * which is associated with the given phy device_node
>> @@ -171,7 +172,6 @@ finish:
>>   }
>>   EXPORT_SYMBOL_GPL(of_usb_get_dr_mode_by_phy);
>> 
>> -#ifdef CONFIG_OF
>>   /**
>>    * of_usb_host_tpl_support - to get if Targeted Peripheral List is 
>> supported
>>    * for given targeted hosts (non-PC hosts)
>
> I just tried the same and this fixes it.

cool, thanks to both of you. Applied to original patch.

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux