Skip to content

Commit b64acb2

Browse files
arndbKalle Valo
authored and
Kalle Valo
committed
ath9k: fix build error with LEDS_CLASS=m
When CONFIG_ATH9K is built-in but LED support is in a loadable module, both ath9k drivers fails to link: x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_deinit_leds': gpio.c:(.text+0x36): undefined reference to `led_classdev_unregister' x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_init_leds': gpio.c:(.text+0x179): undefined reference to `led_classdev_register_ext' The problem is that the 'imply' keyword does not enforce any dependency but is only a weak hint to Kconfig to enable another symbol from a defconfig file. Change imply to a 'depends on LEDS_CLASS' that prevents the incorrect configuration but still allows building the driver without LED support. The 'select MAC80211_LEDS' is now ensures that the LED support is actually used if it is present, and the added Kconfig dependency on MAC80211_LEDS ensures that it cannot be enabled manually when it has no effect. Fixes: 197f466 ("ath9k_htc: Do not select MAC80211_LEDS by default") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Johannes Berg <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0acb20a commit b64acb2

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

drivers/net/wireless/ath/ath9k/Kconfig

+2-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ config ATH9K_BTCOEX_SUPPORT
2121
config ATH9K
2222
tristate "Atheros 802.11n wireless cards support"
2323
depends on MAC80211 && HAS_DMA
24+
select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211
2425
select ATH9K_HW
2526
select ATH9K_COMMON
26-
imply NEW_LEDS
27-
imply LEDS_CLASS
28-
imply MAC80211_LEDS
2927
help
3028
This module adds support for wireless adapters based on
3129
Atheros IEEE 802.11n AR5008, AR9001 and AR9002 family
@@ -176,11 +174,9 @@ config ATH9K_PCI_NO_EEPROM
176174
config ATH9K_HTC
177175
tristate "Atheros HTC based wireless cards support"
178176
depends on USB && MAC80211
177+
select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211
179178
select ATH9K_HW
180179
select ATH9K_COMMON
181-
imply NEW_LEDS
182-
imply LEDS_CLASS
183-
imply MAC80211_LEDS
184180
help
185181
Support for Atheros HTC based cards.
186182
Chipsets supported: AR9271

net/mac80211/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ config MAC80211_MESH
6969
config MAC80211_LEDS
7070
bool "Enable LED triggers"
7171
depends on MAC80211
72-
depends on LEDS_CLASS
72+
depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
7373
select LEDS_TRIGGERS
7474
help
7575
This option enables a few LED triggers for different

0 commit comments

Comments
 (0)