From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH] usb: typec: Ensure USB_ROLE_SWITCH is a dependency for tps6598x
Date: Wed, 20 May 2020 12:52:36 +0100 [thread overview]
Message-ID: <8000f5b7-7652-4a31-6ec2-ac680c830823@linaro.org> (raw)
In-Reply-To: <49a6693e-ed9e-2de6-1dea-ba24b8a3ff4d@linaro.org>
On 20/05/2020 12:22, Bryan O'Donoghue wrote:
> On 20/05/2020 12:13, Bryan O'Donoghue wrote:
>> On 20/05/2020 12:08, Bryan O'Donoghue wrote:
>>> On 20/05/2020 11:35, Heikki Krogerus wrote:
>>>> On Wed, May 20, 2020 at 11:05:26AM +0100, Bryan O'Donoghue wrote:
>>>>> When I switched on USB role switching for the tps6598x I completely
>>>>> forgot
>>>>> to add the Kconfig dependency.
>>>>>
>>>>> This patch ensures the dependency is there to prevent compilation
>>>>> error
>>>>> when role-switching is off.
>>>>
>>>> There are stubs for the those functions, so there should not be any
>>>> compilation errors.
>>>>
>>>
>>> That's what I initially thought too, then I saw this.
>>>
>>> git show da4b5d18dd949abdda7c8ea76c9483b5edd49616
>>>
>>> but looking at role.h
>>>
>>> #if IS_ENABLED(CONFIG_USB_ROLE_SWITCH)
>>>
>>> int usb_role_switch_set_role(struct usb_role_switch *sw, enum
>>> usb_role role);
>>>
>>> #else
>>>
>>> static inline int usb_role_switch_set_role(struct usb_role_switch *sw,
>>> enum usb_role role)
>>> {
>>> return 0;
>>> }
>>>
>>> #endif
>>>
>>> That should work.
>>>
>>> Hmm, let me see if I can figure this out...
>>
>> Well if I do this
>>
>> diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
>> index d53db520e209..636a5428b47e 100644
>> --- a/drivers/usb/chipidea/Kconfig
>> +++ b/drivers/usb/chipidea/Kconfig
>> @@ -6,7 +6,6 @@ config USB_CHIPIDEA
>> select EXTCON
>> select RESET_CONTROLLER
>> select USB_ULPI_BUS
>> - select USB_ROLE_SWITCH
>>
>> my build does this
>
> ah ha - look at what role switch is defaulting to
>
> CONFIG_USB_ROLE_SWITCH=m
>
> So anything linked into the kernel image will not resolve those symbols
So it should be "select USB_ROLE_SWITCH" not "depends on USB_ROLE_SWITCH"
grep -r "USB_ROLE_SWITCH" * | grep depend
drivers/usb/typec/Kconfig: depends on USB_ROLE_SWITCH
grep -r "USB_ROLE_SWITCH" * | grep select
drivers/extcon/Kconfig: select USB_ROLE_SWITCH
drivers/usb/dwc3/Kconfig: select USB_ROLE_SWITCH
drivers/usb/cdns3/Kconfig: select USB_ROLE_SWITCH
drivers/usb/gadget/udc/Kconfig: select USB_ROLE_SWITCH
drivers/usb/mtu3/Kconfig: select USB_ROLE_SWITCH
drivers/usb/musb/Kconfig: select USB_ROLE_SWITCH
drivers/usb/musb/Kconfig: select USB_ROLE_SWITCH
drivers/usb/typec/tcpm/Kconfig: select USB_ROLE_SWITCH
drivers/usb/typec/Kconfig: select USB_ROLE_SWITCH
drivers/usb/typec/mux/Kconfig: select USB_ROLE_SWITCH
drivers/usb/common/Kconfig: select USB_ROLE_SWITCH
next prev parent reply other threads:[~2020-05-20 11:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 10:05 [PATCH] usb: typec: Ensure USB_ROLE_SWITCH is a dependency for tps6598x Bryan O'Donoghue
2020-05-20 10:35 ` Heikki Krogerus
2020-05-20 11:08 ` Bryan O'Donoghue
2020-05-20 11:13 ` Bryan O'Donoghue
2020-05-20 11:22 ` Bryan O'Donoghue
2020-05-20 11:52 ` Bryan O'Donoghue [this message]
2020-05-20 13:10 ` Heikki Krogerus
2020-05-20 18:20 ` kbuild test robot
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=8000f5b7-7652-4a31-6ec2-ac680c830823@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).