Re: [PATCH] r8169: fix building with CONFIG_LEDS_CLASS=m

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03.01.2024 11:26, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
> 
> When r8169 is built-in but the LED support is a loadable module, the
> new code to drive the LED now causes a link failure:
> 
> ld: drivers/net/ethernet/realtek/r8169_leds.o: in function `rtl8168_init_leds':
> r8169_leds.c:(.text+0x36c): undefined reference to `devm_led_classdev_register_ext'
> 
> Add a Kconfig dependency to prevent the broken configuration but still
> allow having the network code built-in as long as CONFIG_LEDS_TRIGGER_NETDEV
> is disabled, regardless of CONFIG_LEDS_CLASS.
> 
The proposed change is more of a workaround IMO. A proper fix (in LED subsystem)
has been submitted, but it's not reviewed/applied yet. And I don't think building
r8169 should depend on support for an optional feature.
This fix would also allow to remove Kconfig dependencies similar to the one
proposed here from other drivers. Link to submitted fix:

https://lore.kernel.org/linux-leds/0f6f432b-c650-4bb8-a1b5-fe3372804d52@xxxxxxxxx/T/#u

> Fixes: 18764b883e15 ("r8169: add support for LED's on RTL8168/RTL8101")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
>  drivers/net/ethernet/realtek/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/realtek/Kconfig b/drivers/net/ethernet/realtek/Kconfig
> index 93d9df55b361..fd3f18b328de 100644
> --- a/drivers/net/ethernet/realtek/Kconfig
> +++ b/drivers/net/ethernet/realtek/Kconfig
> @@ -98,6 +98,7 @@ config 8139_OLD_RX_RESET
>  config R8169
>  	tristate "Realtek 8169/8168/8101/8125 ethernet support"
>  	depends on PCI
> +	depends on LEDS_CLASS || !LEDS_TRIGGER_NETDEV
>  	select FW_LOADER
>  	select CRC32
>  	select PHYLIB





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux