igc: fix LEDS_CLASS dependency
Subsystems (3)
PATCH 1/1 igc: fix LEDS_CLASS dependency
From: Arnd Bergmann <[email protected]>
When IGC is built-in but LEDS_CLASS is a loadable module, there is a link failure:
x86_64-linux-ld: drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'
Add another dependency that prevents this combination.
--- drivers/net/ethernet/intel/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/Kconfig +1 -0
@@ -372,6 +372,7 @@ config IGC config IGC_LEDS def_bool LEDS_TRIGGER_NETDEV depends on IGC && LEDS_CLASS + depends on LEDS_CLASS=y || IGC=m help Optional support for controlling the NIC LED's with the netdev LED trigger.
Signature · 1 line
2.39.2
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When IGC is built-in but
LEDS_CLASSis a loadable module, there is a link failure:
Quoted 7 lines
x86_64-linux-ld:
drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'Add another dependency that prevents this combination.
Fixes ea578703b03d ("igc: Add support for LEDs on i225/i226")Signed-off-by Arnd Bergmann <[email protected]>
Ops, sorry. I tried to build all different combinations, but obviously failed. Thanks for fixing this.
Dear Arnd,
Thank you for the patch.
Am 22.02.24 um 11:02 schrieb Arnd Bergmann:
Quoted 21 lines
From: Arnd Bergmann <[email protected]>
When IGC is built-in but
LEDS_CLASSis a loadable module, there is a link failure:x86_64-linux-ld:
drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'Add another dependency that prevents this combination.
Fixes ea578703b03d ("igc: Add support for LEDs on i225/i226")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/net/ethernet/intel/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/intel/Kconfig +0
-0
drivers/net/ethernet/intel/Kconfig config IGC · line 375
Quoted 4 lines
drivers/net/ethernet/intel/Kconfig +1
-0@@ -372,6 +372,7 @@ config IGC config IGC_LEDS def_bool LEDS_TRIGGER_NETDEV depends on IGC && LEDS_CLASS + depends on LEDS_CLASS=y || IGC=m
Should it be ordered as the line above?
drivers/net/ethernet/intel/Kconfig config IGC · line 378
Quoted 3 lines
drivers/net/ethernet/intel/Kconfig +0
-0help Optional support for controlling the NIC LED's with the netdev LED trigger.
Kind regards,
Paul
Tony Nguyen
maintainerQuoted 21 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When IGC is built-in but
LEDS_CLASSis a loadable module, there is a link failure:x86_64-linux-ld:
drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'Add another dependency that prevents this combination.
Fixes ea578703b03d ("igc: Add support for LEDs on i225/i226")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/net/ethernet/intel/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/intel/Kconfig +0
-0
drivers/net/ethernet/intel/Kconfig config IGC · line 375
Quoted 4 lines
drivers/net/ethernet/intel/Kconfig +1
-0@@ -372,6 +372,7 @@ config IGC config IGC_LEDS def_bool LEDS_TRIGGER_NETDEV depends on IGC && LEDS_CLASS + depends on LEDS_CLASS=y || IGC=m
I don't know kbuild that well, but would this cover LEDS_CLASS=n with IGC=m?
There are Similar checks in the file [1][2] that would transpose to
depends on IGC && LEDS_CLASS && !(IGC=y && LEDS_CLASS=m)
which should cover that and keep the checks in the file consistent. IMO a little more readable as well.
Thanks,
Tony
[1] https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/intel/Kconfig#L109
[2] https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/intel/Kconfig#L161
Quoted 3 lines
drivers/net/ethernet/intel/Kconfig +0
-0help Optional support for controlling the NIC LED's with the netdev LED trigger.
Quoted 13 lines · Tony Nguyen
drivers/net/ethernet/intel/Kconfig config IGC · line 375
Quoted 10 lines · Arnd Bergmann
drivers/net/ethernet/intel/Kconfig +1
-0@@ -372,6 +372,7 @@ config IGC config IGC_LEDS def_bool LEDS_TRIGGER_NETDEV depends on IGC && LEDS_CLASS + depends on LEDS_CLASS=y || IGC=mI don't know kbuild that well, but would this cover LEDS_CLASS=n with IGC=m?
The 'depends on LEDS_CLASS' take care of that.
Quoted 5 lines
There are Similar checks in the file [1][2] that would transpose to
depends on IGC &&LEDS_CLASS&& !(IGC=y && LEDS_CLASS=m)which should cover that and keep the checks in the file consistent. IMO a little more readable as well.
Right, that works as well. I find the negative dependencies slightly more confusing, they should do the same thing here. Please apply whichever version makes most sense to you then.
Arnd