Skip to contentSkip to conversation

power: supply: add EXTCON dependency

PATCH Applied Arnd Bergmann 2 participants 2 messages May 3, 2025 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: add EXTCON dependency

From: Arnd Bergmann <[email protected]>

max8971 is written to work with or without extcon, but it fails to link when built-in when the extcon subsystem is in a loadable module:

x86_64-linux-ld: drivers/power/supply/max8971_charger.o: in function `max8971_probe':
max8971_charger.c:(.text+0x2ab): undefined reference to `extcon_find_edev_by_node'

Add the appropriate dependency that allows the working cases but prevents the link failure.

Fixes 60cd40eee4f4 ("power: supply: Add support for Maxim MAX8971 charger")
---
 drivers/power/supply/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/Kconfig +1 -0
index 797c8d1b04aa..daab8214e225 100644
@@ -621,6 +621,7 @@ config CHARGER_MAX77976
 config CHARGER_MAX8971
 	tristate "Maxim MAX8971 battery charger driver"
 	depends on I2C
+	depends on EXTCON || !EXTCON
 	select REGMAP_I2C
 	help
 	  The MAX8971 is a compact, high-frequency, high-efficiency switch-mode
Signature · 1 line
2.39.5
#1 lore raw
Quoted 8 lines · Arnd Bergmann

max8971 is written to work with or without extcon, but it fails to link when built-in when the extcon subsystem is in a loadable module:

x86_64-linux-ld: drivers/power/supply/max8971_charger.o: in function `max8971_probe':
max8971_charger.c:(.text+0x2ab): undefined reference to `extcon_find_edev_by_node'

[...]

Applied, thanks!

[1/1] power: supply: add EXTCON dependency

      commit: 1ea48c51f03fc3186ee0bcc05d06b652c209e0ae

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>