linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [v2] ath5k: fix building with LEDS=m
@ 2021-09-20 12:23 Arnd Bergmann
  2021-09-20 12:48 ` Kalle Valo
  2021-09-24 11:08 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-09-20 12:23 UTC (permalink / raw)
  To: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, Kalle Valo,
	David S. Miller, Jakub Kicinski, Arnd Bergmann, Johannes Berg,
	Krzysztof Kozlowski, Bob Copeland, John W. Linville
  Cc: linux-wireless, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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: 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")
Link: https://lore.kernel.org/all/20210722105501.1000781-1-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Changes in v2:
- avoid link failure when NEW_LEDS is disabled
---
 drivers/net/wireless/ath/ath5k/Kconfig |  4 +---
 drivers/net/wireless/ath/ath5k/led.c   | 10 ++++++----
 2 files changed, 7 insertions(+), 7 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
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index 6a2a16856763..33e9928af363 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -89,7 +89,8 @@ static const struct pci_device_id ath5k_led_devices[] = {
 
 void ath5k_led_enable(struct ath5k_hw *ah)
 {
-	if (test_bit(ATH_STAT_LEDSOFT, ah->status)) {
+	if (IS_ENABLED(CONFIG_MAC80211_LEDS) &&
+	    test_bit(ATH_STAT_LEDSOFT, ah->status)) {
 		ath5k_hw_set_gpio_output(ah, ah->led_pin);
 		ath5k_led_off(ah);
 	}
@@ -104,7 +105,8 @@ static void ath5k_led_on(struct ath5k_hw *ah)
 
 void ath5k_led_off(struct ath5k_hw *ah)
 {
-	if (!test_bit(ATH_STAT_LEDSOFT, ah->status))
+	if (!IS_ENABLED(CONFIG_MAC80211_LEDS) ||
+	    !test_bit(ATH_STAT_LEDSOFT, ah->status))
 		return;
 	ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on);
 }
@@ -146,7 +148,7 @@ ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led,
 static void
 ath5k_unregister_led(struct ath5k_led *led)
 {
-	if (!led->ah)
+	if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah)
 		return;
 	led_classdev_unregister(&led->led_dev);
 	ath5k_led_off(led->ah);
@@ -169,7 +171,7 @@ int ath5k_init_leds(struct ath5k_hw *ah)
 	char name[ATH5K_LED_MAX_NAME_LEN + 1];
 	const struct pci_device_id *match;
 
-	if (!ah->pdev)
+	if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev)
 		return 0;
 
 #ifdef CONFIG_ATH5K_AHB
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [v2] ath5k: fix building with LEDS=m
  2021-09-20 12:23 [PATCH] [v2] ath5k: fix building with LEDS=m Arnd Bergmann
@ 2021-09-20 12:48 ` Kalle Valo
  2021-09-24 11:08 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-09-20 12:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, David S. Miller,
	Jakub Kicinski, Arnd Bergmann, Johannes Berg,
	Krzysztof Kozlowski, Bob Copeland, John W. Linville,
	linux-wireless, netdev, linux-kernel

Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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: 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")
> Link: https://lore.kernel.org/all/20210722105501.1000781-1-arnd@kernel.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Changes in v2:
> - avoid link failure when NEW_LEDS is disabled

I'll queue this to v5.15.

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [v2] ath5k: fix building with LEDS=m
  2021-09-20 12:23 [PATCH] [v2] ath5k: fix building with LEDS=m Arnd Bergmann
  2021-09-20 12:48 ` Kalle Valo
@ 2021-09-24 11:08 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-09-24 11:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, David S. Miller,
	Jakub Kicinski, Arnd Bergmann, Johannes Berg,
	Krzysztof Kozlowski, Bob Copeland, John W. Linville,
	linux-wireless, netdev, linux-kernel

Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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: 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")
> Link: https://lore.kernel.org/all/20210722105501.1000781-1-arnd@kernel.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied to wireless-drivers.git, thanks.

fb8c3a3c5240 ath5k: fix building with LEDS=m

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210920122359.353810-1-arnd@kernel.org/

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-24 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 12:23 [PATCH] [v2] ath5k: fix building with LEDS=m Arnd Bergmann
2021-09-20 12:48 ` Kalle Valo
2021-09-24 11:08 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).