Skip to contentSkip to conversation

usb: select USB_COMMON for usb role switch config

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 4, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: select USB_COMMON for usb role switch config

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")
---
 drivers/usb/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/Kconfig +1 -0
index 75f7fb151f71..987fc5ba6321 100644
@@ -207,5 +207,6 @@ config USB_ULPI_BUS
 
 config USB_ROLE_SWITCH
 	tristate
+	select USB_COMMON
 
 endif # USB_SUPPORT
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 13 lines · Arnd Bergmann

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'

Quoted 6 lines

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")

Thanks.

I agree that this is the right way to fix this (matches the other drivers/usb/Kconfig bits):

Regards,

Hans

Quoted 10 lines
---
  drivers/usb/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/usb/Kconfig +0 -0
index 75f7fb151f71..987fc5ba6321 100644

drivers/usb/Kconfig config USB_ULPI_BUS · line 212

Quoted 6 lines
drivers/usb/Kconfig +1 -0
@@ -207,5 +207,6 @@ config USB_ULPI_BUS
 
  config USB_ROLE_SWITCH
  	tristate
+	select USB_COMMON
 
  endif # USB_SUPPORT

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html