extcon: axp288: fix link error
PATCH 1/1 extcon: axp288: fix link error
With CONFIG_AXP288=y and CONFIG_USB_COMMON=n there is the following link error:
drivers/extcon/extcon-axp288.o: In function `axp288_put_role_sw':
extcon-axp288.c:(.text+0xa0): undefined reference to usb_role_switch_put' drivers/extcon/extcon-axp288.o: In function axp288_usb_role_work':
extcon-axp288.c:(.text+0xec): undefined reference to usb_role_switch_get_role' extcon-axp288.c:(.text+0x12c): undefined reference to usb_role_switch_set_role' drivers/extcon/extcon-axp288.o: In function `axp288_extcon_probe':
extcon-axp288.c:(.text+0x59d): undefined reference to `usb_role_switch_get'
The above functions are defined in drivers/usb/common/roles.c, but the build system only enters the common directory depending on CONFIG_USB_COMMON. Fix this by selecting the USB_COMMON symbol.
---
Hi,
there is another solution for this problem: replace depends on USB_SUPPORT with depends on USB, but since CONFIG_USB selects other symbols I went with the minimal fix and select the USB_COMMON symbol.
--- drivers/extcon/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/extcon/Kconfig +1 -0
@@ -31,6 +31,7 @@ config EXTCON_ARIZONA config EXTCON_AXP288 tristate "X-Power AXP288 EXTCON support" depends on MFD_AXP20X && USB_SUPPORT && X86 + select USB_COMMON select USB_ROLE_SWITCH help Say Y here to enable support for USB peripheral detection
Signature · 1 line
2.17.0
Hi,
Quoted 11 lines · Tobias Regnery
With
CONFIG_AXP288=yandCONFIG_USB_COMMON=nthere is the following link error:
drivers/extcon/extcon-axp288.o: In function `axp288_put_role_sw':
extcon-axp288.c:(.text+0xa0): undefined reference tousb_role_switch_put' drivers/extcon/extcon-axp288.o: In functionaxp288_usb_role_work':
extcon-axp288.c:(.text+0xec): undefined reference tousb_role_switch_get_role' extcon-axp288.c:(.text+0x12c): undefined reference tousb_role_switch_set_role'drivers/extcon/extcon-axp288.o: In function `axp288_extcon_probe':
extcon-axp288.c:(.text+0x59d): undefined reference to `usb_role_switch_get'
Quoted 6 lines
The above functions are defined in
drivers/usb/common/roles.c, but the build system only enters the common directory depending onCONFIG_USB_COMMON. Fix this by selecting theUSB_COMMONsymbol.Fixes d54f063cdbe4 ("extcon: axp288: Set USB role where necessary")Signed-off-by Tobias Regnery <[email protected]>
Patch looks good to me, thanks:
Regards,
Hans
Quoted 23 lines
---
Hi,there is another solution for this problem: replace depends on
USB_SUPPORTwith depends on USB, but sinceCONFIG_USBselects other symbols I went with the minimal fix and select theUSB_COMMONsymbol.--- drivers/extcon/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/extcon/Kconfig +1
-0@@ -31,6 +31,7 @@ config EXTCON_ARIZONA config EXTCON_AXP288 tristate "X-Power AXP288 EXTCON support" depends on MFD_AXP20X && USB_SUPPORT && X86 + select USB_COMMON select USB_ROLE_SWITCH help Say Y here to enable support for USB peripheral detection