Skip to contentSkip to conversation

net: dsa: realtek: add LEDS_CLASS dependency

PATCH In review Arnd Bergmann 3 participants 6 messages May 28, 2024 – Sep 2, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: realtek: add LEDS_CLASS dependency

From: Arnd Bergmann <[email protected]>

This driver fails to link when LED support is disabled:

ERROR: modpost: "led_init_default_state_get" [drivers/net/dsa/realtek/rtl8366.ko] undefined!
ERROR: modpost: "devm_led_classdev_register_ext" [drivers/net/dsa/realtek/rtl8366.ko] undefined!

Add a dependency that prevents this configuration.

Fixes 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")
---
 drivers/net/dsa/realtek/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/net/dsa/realtek/Kconfig +1 -0
index 6989972eebc3..6c90a83c71da 100644
@@ -39,6 +39,7 @@ config NET_DSA_REALTEK_RTL8365MB
 config NET_DSA_REALTEK_RTL8366RB
 	tristate "Realtek RTL8366RB switch driver"
 	depends on NET_DSA_REALTEK_SMI || NET_DSA_REALTEK_MDIO
+	depends on LEDS_CLASS
 	select NET_DSA_TAG_RTL4_A
 	help
 	  Select to enable support for Realtek RTL8366RB.
Signature · 1 line
2.39.2
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This driver fails to link when LED support is disabled:

ERROR: modpost: "led_init_default_state_get" [drivers/net/dsa/realtek/rtl8366.ko] undefined!
ERROR: modpost: "devm_led_classdev_register_ext" [drivers/net/dsa/realtek/rtl8366.ko] undefined!

Add a dependency that prevents this configuration.

Fixes 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")

The QCA driver in drivers/net/dsa/qca/* instead makes the feature optional on LED class, so it is in a separate file with stubs if the LED class is not selected.

Luiz do you wanna try this or should I make a patch like that?

Yours,
Linus Walleij

#2 lore raw
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines

From: Arnd Bergmann <[email protected]>

This driver fails to link when LED support is disabled:

ERROR: modpost: "led_init_default_state_get" [drivers/net/dsa/realtek/rtl8366.ko] undefined!
ERROR: modpost: "devm_led_classdev_register_ext" [drivers/net/dsa/realtek/rtl8366.ko] undefined!

Quoted 8 lines
Quoted 4 lines

Add a dependency that prevents this configuration.

Fixes 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")

The QCA driver in drivers/net/dsa/qca/* instead makes the feature optional on LED class, so it is in a separate file with stubs if the LED class is not selected.

That would be great.

Quoted 1 line

Luiz do you wanna try this or should I make a patch like that?

You can do it. I'm a bit away from programming these days. Thanks.

Quoted 2 lines

Yours,
Linus Walleij

Regards,

Luiz

Reviewed-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This driver fails to link when LED support is disabled:

ERROR: modpost: "led_init_default_state_get" [drivers/net/dsa/realtek/rtl8366.ko] undefined!
ERROR: modpost: "devm_led_classdev_register_ext" [drivers/net/dsa/realtek/rtl8366.ko] undefined!

Add a dependency that prevents this configuration.

Fixes 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")

I tried to create a separate .c file for the leds and stubbed functions for the LED stuff, but it ended up having to create a set of headers just to share things between the different parts of the drivers and it was so messy that it's not worth it.

Yours,
Linus Walleij

maintainer Reviewed-by
#4 lore raw
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines

From: Arnd Bergmann <[email protected]>

This driver fails to link when LED support is disabled:

ERROR: modpost: "led_init_default_state_get" [drivers/net/dsa/realtek/rtl8366.ko] undefined!
ERROR: modpost: "devm_led_classdev_register_ext" [drivers/net/dsa/realtek/rtl8366.ko] undefined!

Add a dependency that prevents this configuration.

Thank you, Arnd.

Quoted 10 lines
Quoted 3 lines
Fixes 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")

I tried to create a separate .c file for the leds and stubbed functions for the LED stuff, but it ended up having to create a set of headers just to share things between the different parts of the drivers and it was so messy that it's not worth it.

Thanks, Linus. I'll give it a try next month. For now, the fixed dependency is not a big deal as this switch was designed for small routers, which normally have LEDs.

Quoted 3 lines

Yours,
Linus Walleij

#5 lore raw
In reply to Arnd Bergmann

Hi David/Jakub,

Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This driver fails to link when LED support is disabled:

ERROR: modpost: "led_init_default_state_get" [drivers/net/dsa/realtek/rtl8366.ko] undefined!
ERROR: modpost: "devm_led_classdev_register_ext" [drivers/net/dsa/realtek/rtl8366.ko] undefined!

Add a dependency that prevents this configuration.

Fixes 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")

Can you please apply this patch, the buildbots keep complaining about this, and we agreed (I think) to take this dependency approach for now.

Yours,
Linus Walleij