brcmsmac: rework LED dependencies
authorArnd Bergmann <arnd@arndb.de>
Sat, 4 Dec 2021 17:38:34 +0000 (18:38 +0100)
committerKalle Valo <kvalo@kernel.org>
Wed, 8 Dec 2021 18:17:06 +0000 (20:17 +0200)
This is now the only driver that selects the LEDS_CLASS framework,
which is normally user-selectable. While it doesn't strictly cause
a bug, rework the Kconfig logic to be more consistent with what
other drivers do, and only enable LED support in brcmsmac if the
dependencies are all there, rather than using 'select' to enable
what it needs.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211204173848.873293-2-arnd@kernel.org
drivers/net/wireless/broadcom/brcm80211/Kconfig
drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile
drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.h

index 5bf2318763c55b5a11a7d2cebc3114ffd61a6373..3a1a35b5672f1a27911a287579a7ce737a157f0e 100644 (file)
@@ -7,16 +7,20 @@ config BRCMSMAC
        depends on MAC80211
        depends on BCMA_POSSIBLE
        select BCMA
-       select NEW_LEDS if BCMA_DRIVER_GPIO
-       select LEDS_CLASS if BCMA_DRIVER_GPIO
        select BRCMUTIL
        select FW_LOADER
        select CORDIC
        help
          This module adds support for PCIe wireless adapters based on Broadcom
-         IEEE802.11n SoftMAC chipsets. It also has WLAN led support, which will
-         be available if you select BCMA_DRIVER_GPIO. If you choose to build a
-         module, the driver will be called brcmsmac.ko.
+         IEEE802.11n SoftMAC chipsets. If you choose to build a module, the
+         driver will be called brcmsmac.ko.
+
+config BRCMSMAC_LEDS
+       def_bool BRCMSMAC && BCMA_DRIVER_GPIO && MAC80211_LEDS
+       help
+         The brcmsmac LED support depends on the presence of the
+         BCMA_DRIVER_GPIO driver, and it only works if LED support
+         is enabled and reachable from the driver module.
 
 source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig"
 
index 482d7737764da76c4ae253641f0d30408dbe28ec..090757730ba60db0708afb5093ddb4cc90ce8e00 100644 (file)
@@ -42,6 +42,6 @@ brcmsmac-y := \
        brcms_trace_events.o \
        debug.o
 
-brcmsmac-$(CONFIG_BCMA_DRIVER_GPIO) += led.o
+brcmsmac-$(CONFIG_BRCMSMAC_LEDS) += led.o
 
 obj-$(CONFIG_BRCMSMAC) += brcmsmac.o
index d65f5c268fd77490a3b2a7d573fe229542408f06..2a5cbeb9e783122b00266b809b3b8853815d246e 100644 (file)
@@ -24,7 +24,7 @@ struct brcms_led {
        struct gpio_desc *gpiod;
 };
 
-#ifdef CONFIG_BCMA_DRIVER_GPIO
+#ifdef CONFIG_BRCMSMAC_LEDS
 void brcms_led_unregister(struct brcms_info *wl);
 int brcms_led_register(struct brcms_info *wl);
 #else