]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
leds: blinkm: Fix CONFIG_LEDS_CLASS_MULTICOLOR dependency
authorArnd Bergmann <arnd@arndb.de>
Wed, 7 Aug 2024 07:55:53 +0000 (09:55 +0200)
committerLee Jones <lee@kernel.org>
Fri, 16 Aug 2024 16:04:42 +0000 (17:04 +0100)
With CONFIG_LEDS_CLASS_MULTICOLOR=m, a builtin leds-blinkm driver causes
a link failure:

arm-linux-gnueabi-ld: drivers/leds/leds-blinkm.o: in function `blinkm_set_mc_brightness':
leds-blinkm.c:(.text.blinkm_set_mc_brightness+0xc): undefined reference to `led_mc_calc_color_components'

Add a more specific dependency that only allows multicoler mode to
be enabled for blinkm if it can build and link.

Fixes: 56e8c56c9af0 ("leds: Add multicolor support to BlinkM LED driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Joseph Strauss <jstrauss@mailbox.org>
Link: https://lore.kernel.org/r/20240807075614.2118068-1-arnd@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/Kconfig

index 2e78318673151927aeb4b41019d3425de45a69a4..b784bb74a8378a18735d0878f614680371c59064 100644 (file)
@@ -828,7 +828,7 @@ config LEDS_BLINKM
 config LEDS_BLINKM_MULTICOLOR
        bool "Enable multicolor support for BlinkM I2C RGB LED"
        depends on LEDS_BLINKM
-       depends on LEDS_CLASS_MULTICOLOR
+       depends on LEDS_CLASS_MULTICOLOR=y || LEDS_CLASS_MULTICOLOR=LEDS_BLINKM
        help
          This option enables multicolor sysfs class support for BlinkM LED and
          disables the older, separated sysfs interface