* [PATCH] usb: select USB_COMMON for usb role switch config
@ 2018-04-04 12:21 Arnd Bergmann
2018-04-04 20:08 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-04-04 12:21 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Hans de Goede, Andy Shevchenko, Heikki Krogerus, Arnd Bergmann,
linux-usb, linux-kernel
The new axp288 extcon driver has no dependency on USB itself but
calls the usb role switch helper functions. This causes a link error
when USB_COMMON is disabled, as that subdirectory never gets entered:
drivers/extcon/extcon-axp288.o: In function `axp288_usb_role_work':
extcon-axp288.c:(.text+0x47b): undefined reference to `usb_role_switch_set_role'
extcon-axp288.c:(.text+0x498): undefined reference to `usb_role_switch_get_role'
drivers/extcon/extcon-axp288.o: In function `axp288_extcon_probe':
extcon-axp288.c:(.text+0x675): undefined reference to `usb_role_switch_get'
extcon-axp288.c:(.text+0x6d1): undefined reference to `usb_role_switch_put'
drivers/extcon/extcon-axp288.o: In function `axp288_put_role_sw':
extcon-axp288.c:(.text+0x1c): undefined reference to `usb_role_switch_put'
There are multiple ways of fixing this, I chose to 'select USB_COMMON',
since that is how we solved the same problem for other helpers like
USB_LED_TRIG or PHY drivers.
Fixes: d54f063cdbe4 ("extcon: axp288: Set USB role where necessary")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/usb/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 75f7fb151f71..987fc5ba6321 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -207,5 +207,6 @@ config USB_ULPI_BUS
config USB_ROLE_SWITCH
tristate
+ select USB_COMMON
endif # USB_SUPPORT
--
2.9.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] usb: select USB_COMMON for usb role switch config
2018-04-04 12:21 [PATCH] usb: select USB_COMMON for usb role switch config Arnd Bergmann
@ 2018-04-04 20:08 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2018-04-04 20:08 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman
Cc: Andy Shevchenko, Heikki Krogerus, linux-usb, linux-kernel
Hi,
On 04-04-18 14:21, Arnd Bergmann wrote:
> The new axp288 extcon driver has no dependency on USB itself but
> calls the usb role switch helper functions. This causes a link error
> when USB_COMMON is disabled, as that subdirectory never gets entered:
>
> drivers/extcon/extcon-axp288.o: In function `axp288_usb_role_work':
> extcon-axp288.c:(.text+0x47b): undefined reference to `usb_role_switch_set_role'
> extcon-axp288.c:(.text+0x498): undefined reference to `usb_role_switch_get_role'
> drivers/extcon/extcon-axp288.o: In function `axp288_extcon_probe':
> extcon-axp288.c:(.text+0x675): undefined reference to `usb_role_switch_get'
> extcon-axp288.c:(.text+0x6d1): undefined reference to `usb_role_switch_put'
> drivers/extcon/extcon-axp288.o: In function `axp288_put_role_sw':
> extcon-axp288.c:(.text+0x1c): undefined reference to `usb_role_switch_put'
>
> There are multiple ways of fixing this, I chose to 'select USB_COMMON',
> since that is how we solved the same problem for other helpers like
> USB_LED_TRIG or PHY drivers.
>
> Fixes: d54f063cdbe4 ("extcon: axp288: Set USB role where necessary")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks.
I agree that this is the right way to fix this (matches the other
drivers/usb/Kconfig bits):
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/usb/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> index 75f7fb151f71..987fc5ba6321 100644
> --- a/drivers/usb/Kconfig
> +++ b/drivers/usb/Kconfig
> @@ -207,5 +207,6 @@ config USB_ULPI_BUS
>
> config USB_ROLE_SWITCH
> tristate
> + select USB_COMMON
>
> endif # USB_SUPPORT
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-04 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-04 12:21 [PATCH] usb: select USB_COMMON for usb role switch config Arnd Bergmann
2018-04-04 20:08 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®