Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: blinkm: Fix CONFIG_LEDS_CLASS_MULTICOLOR dependency

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>

authored by

Arnd Bergmann and committed by
Lee Jones
17c40f3c 82c5ada1

+1 -1
+1 -1
drivers/leds/Kconfig
··· 828 828 config LEDS_BLINKM_MULTICOLOR 829 829 bool "Enable multicolor support for BlinkM I2C RGB LED" 830 830 depends on LEDS_BLINKM 831 - depends on LEDS_CLASS_MULTICOLOR 831 + depends on LEDS_CLASS_MULTICOLOR=y || LEDS_CLASS_MULTICOLOR=LEDS_BLINKM 832 832 help 833 833 This option enables multicolor sysfs class support for BlinkM LED and 834 834 disables the older, separated sysfs interface