Re: [PATCH] extcon: ptn5150: add usb role class support
From: Krzysztof Kozlowski
Date: Tue Apr 19 2022 - 05:52:22 EST
On 19/04/2022 11:12, Krzysztof Kozlowski wrote:
> On 19/04/2022 10:51, Jun Li wrote:
>> My test config is making USB_ROLE_SWITCH=m, but PTN5150=y
>>
>> So with below header file:
>>
>> #if IS_ENABLED(CONFIG_USB_ROLE_SWITCH)
>> void usb_role_switch_put(struct usb_role_switch *sw);
>> #else
>> static inline void usb_role_switch_put(struct usb_role_switch *sw) { }
>> #endif
>>
>> Will have link error.
>
> Yep, true. I cannot remember the solution for that... With the select
> you cannot disable USB_ROLE_SWITCH. With "depends on X || depends on
> !X", one still cannot disable USB_ROLE_SWITCH. However this is a common
> problem and I am pretty sure people were working on this. :)
Use:
depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH'
this should solve the problem.
Best regards,
Krzysztof