2021-07-22 10:55:43

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] ath5k: fix building with LEDS=m

From: Arnd Bergmann <[email protected]>

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.

Alternatively, we could just drop the 'select' from both ath5k and
ath9k.

Fixes: b64acb28da83 ("ath9k: fix build error with LEDS_CLASS=m")
Fixes: 72cdab808714 ("ath9k: Do not select MAC80211_LEDS by default")
Fixes: 3a078876caee ("ath5k: convert LED code to use mac80211 triggers")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/net/wireless/ath/ath5k/Kconfig | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig
index f35cd8de228e..6914b37bb0fb 100644
--- a/drivers/net/wireless/ath/ath5k/Kconfig
+++ b/drivers/net/wireless/ath/ath5k/Kconfig
@@ -3,9 +3,7 @@ config ATH5K
tristate "Atheros 5xxx wireless cards support"
depends on (PCI || ATH25) && MAC80211
select ATH_COMMON
- select MAC80211_LEDS
- select LEDS_CLASS
- select NEW_LEDS
+ select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211
select ATH5K_AHB if ATH25
select ATH5K_PCI if !ATH25
help
--
2.29.2


2021-08-01 11:41:18

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath5k: fix building with LEDS=m

(oddly linux-wireless was dropped, adding it back in hopes that
patchwork sees this)

Arnd Bergmann <[email protected]> writes:

> On Fri, Jul 23, 2021 at 10:41 AM kernel test robot <[email protected]> wrote:
>>
>> All errors (new ones prefixed by >>):
>>
>> mips-linux-ld: drivers/net/wireless/ath/ath5k/led.o: in function
>> `ath5k_register_led.constprop.0':
>> >> led.c:(.text+0x58): undefined reference to `led_classdev_register_ext'
>> mips-linux-ld: drivers/net/wireless/ath/ath5k/led.o: in function
>> `ath5k_unregister_leds':
>> >> led.c:(.text+0x1d8): undefined reference to `led_classdev_unregister'
>> >> mips-linux-ld: led.c:(.text+0x208): undefined reference to
>> >> `led_classdev_unregister'
>
> Ok, nevermind then, please ignore my patch. I don't see this
> particular build failure on
> my randconfig test box, which probably means I have some other patch
> applied that
> avoids this. I may get back to this in the future but can't figure it
> out at the moment.
>
> My feeling now is that the 'select' should just be removed entirely, and then
> we can have an 'if (!IS_ENABLED(CONFIG_MAC80211_LEDS)) return 0;'
> in ath5k_register_led().
>
> Arnd

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches