Skip to contentSkip to conversation

leds: blinkm: fix CONFIG_LEDS_CLASS_MULTICOLOR dependency

PATCH Applied Arnd Bergmann 3 participants 3 messages Aug 7, 2024 – Aug 16, 2024 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: blinkm: fix CONFIG_LEDS_CLASS_MULTICOLOR dependency

From: Arnd Bergmann <[email protected]>

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")
---
 drivers/leds/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -1
index 41214c9b93ba..818c8bdd047e 100644
@@ -838,7 +838,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
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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")
---
 drivers/leds/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -1
index 41214c9b93ba..818c8bdd047e 100644
@@ -838,7 +838,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
Signature · 1 line
2.39.2

Hi,

I was able to reproduce the issue and the fix works. Thank you!

maintainer Applied
#2 lore raw

Re: (subset) [PATCH] leds: blinkm: fix CONFIG_LEDS_CLASS_MULTICOLOR dependency

In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

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.

[...]

Applied, thanks!

[1/1] leds: blinkm: fix CONFIG_LEDS_CLASS_MULTICOLOR dependency

      commit: 17c40f3c94bc2279b879ea9ceb3eea973bcd1ac4

--
Lee Jones [李琼斯]