]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
power: supply: max77976: add EXTCON dependency
authorArnd Bergmann <arnd@arndb.de>
Sat, 3 May 2025 14:04:26 +0000 (16:04 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sat, 3 May 2025 17:16:59 +0000 (19:16 +0200)
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250503140431.438727-1-arnd@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/Kconfig

index fa6062002cab407bc4bbea1fe6e8c8e3e96b58e7..79ddb006e2dad6bf96b71ed570a37c006b5f9433 100644 (file)
@@ -620,6 +620,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