Re: [PATCH] net: dsa: realtek: add LEDS_CLASS dependency

From: Luiz Angelo Daros de Luca
Date: Tue Jun 11 2024 - 20:03:27 EST


> On Tue, May 28, 2024 at 2:04 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
> > From: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > 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@xxxxxxxx>
>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
>
> 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@xxxxxxxxx>