diff mbox series

net: dsa: realtek: add LEDS_CLASS dependency

Message ID 20240528120424.3353880-1-arnd@kernel.org (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: realtek: add LEDS_CLASS dependency | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-29--21-00 (tests: 1041)

Commit Message

Arnd Bergmann May 28, 2024, 12:03 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/dsa/realtek/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij May 28, 2024, 12:17 p.m. UTC | #1
On Tue, May 28, 2024 at 2:04 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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
Luiz Angelo Daros de Luca June 8, 2024, 4:03 p.m. UTC | #2
> On Tue, May 28, 2024 at 2:04 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > 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")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> 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.

> 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.

> Yours,
> Linus Walleij

Regards,

Luiz
Linus Walleij June 11, 2024, 10:13 p.m. UTC | #3
On Tue, May 28, 2024 at 2:04 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

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
Luiz Angelo Daros de Luca June 12, 2024, 12:03 a.m. UTC | #4
> On Tue, May 28, 2024 at 2:04 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > 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.

> >
> > Fixes: 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> 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.

>
> Yours,
> Linus Walleij

Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Linus Walleij Sept. 2, 2024, 8:04 a.m. UTC | #5
Hi David/Jakub,

On Tue, May 28, 2024 at 2:04 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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
diff mbox series

Patch

diff --git a/drivers/net/dsa/realtek/Kconfig b/drivers/net/dsa/realtek/Kconfig
index 6989972eebc3..6c90a83c71da 100644
--- a/drivers/net/dsa/realtek/Kconfig
+++ b/drivers/net/dsa/realtek/Kconfig
@@ -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.