Skip to content

Commit 1c18668

Browse files
arndbgregkh
authored andcommitted
ath5k: fix building with LEDS=m
[ Upstream commit fb8c3a3 ] Randconfig builds still show a failure for the ath5k driver, similar to the one that was fixed for ath9k earlier: WARNING: unmet direct dependencies detected for MAC80211_LEDS Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y]) Selected by [m]: - ATH5K [=m] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_ATH [=y] && (PCI [=y] || ATH25) && MAC80211 [=y] net/mac80211/led.c: In function 'ieee80211_alloc_led_names': net/mac80211/led.c:34:22: error: 'struct led_trigger' has no member named 'name' 34 | local->rx_led.name = kasprintf(GFP_KERNEL, "%srx", | ^ Copying the same logic from my ath9k patch makes this one work as well, stubbing out the calls to the LED subsystem. Fixes: b64acb2 ("ath9k: fix build error with LEDS_CLASS=m") Fixes: 72cdab8 ("ath9k: Do not select MAC80211_LEDS by default") Fixes: 3a07887 ("ath5k: convert LED code to use mac80211 triggers") Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 436f61a commit 1c18668

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

drivers/net/wireless/ath/ath5k/Kconfig

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ config ATH5K
33
tristate "Atheros 5xxx wireless cards support"
44
depends on (PCI || ATH25) && MAC80211
55
select ATH_COMMON
6-
select MAC80211_LEDS
7-
select LEDS_CLASS
8-
select NEW_LEDS
6+
select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211
97
select ATH5K_AHB if ATH25
108
select ATH5K_PCI if !ATH25
119
help

drivers/net/wireless/ath/ath5k/led.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ static const struct pci_device_id ath5k_led_devices[] = {
8989

9090
void ath5k_led_enable(struct ath5k_hw *ah)
9191
{
92-
if (test_bit(ATH_STAT_LEDSOFT, ah->status)) {
92+
if (IS_ENABLED(CONFIG_MAC80211_LEDS) &&
93+
test_bit(ATH_STAT_LEDSOFT, ah->status)) {
9394
ath5k_hw_set_gpio_output(ah, ah->led_pin);
9495
ath5k_led_off(ah);
9596
}
@@ -104,7 +105,8 @@ static void ath5k_led_on(struct ath5k_hw *ah)
104105

105106
void ath5k_led_off(struct ath5k_hw *ah)
106107
{
107-
if (!test_bit(ATH_STAT_LEDSOFT, ah->status))
108+
if (!IS_ENABLED(CONFIG_MAC80211_LEDS) ||
109+
!test_bit(ATH_STAT_LEDSOFT, ah->status))
108110
return;
109111
ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on);
110112
}
@@ -146,7 +148,7 @@ ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led,
146148
static void
147149
ath5k_unregister_led(struct ath5k_led *led)
148150
{
149-
if (!led->ah)
151+
if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah)
150152
return;
151153
led_classdev_unregister(&led->led_dev);
152154
ath5k_led_off(led->ah);
@@ -169,7 +171,7 @@ int ath5k_init_leds(struct ath5k_hw *ah)
169171
char name[ATH5K_LED_MAX_NAME_LEN + 1];
170172
const struct pci_device_id *match;
171173

172-
if (!ah->pdev)
174+
if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev)
173175
return 0;
174176

175177
#ifdef CONFIG_ATH5K_AHB

0 commit comments

Comments
 (0)