Re: [PATCH] brcmsmac: Fix build dep on LEDS_CLASS

Borislav Petkov
2013-11-18T20:40:09Z

On Mon, Nov 18, 2013 at 02:32:50PM +0100, Borislav Petkov wrote:
> On Mon, Nov 18, 2013 at 12:58:58PM +0100, Rafał Miłecki wrote:
> > Borislav: I think I didn't get your original patch.
>
> Forget it, I'll send a better one later.

Ok, let's try another one. I've done it with depends but we
probably could select LEDS_CLASS in BRCMSMAC_LED as it is required
functionality...

---
From: Borislav Petkov <bp@suse.de>
Subject: [PATCH -v2] brcmsmac: Fix build dep on LEDS_CLASS

When building randconfigs with CONFIG_BCMA_DRIVER_GPIO=y, I get

drivers/built-in.o: In function `brcms_led_unregister':
(.text+0x351aca): undefined reference to `led_classdev_unregister'
drivers/built-in.o: In function `brcms_led_register':
(.text+0x351c65): undefined reference to `led_classdev_register'

during final linking stage because brcmsmac/led.c needs LEDS_CLASS for
registering/deregistering the led device. Add a promptless Kconfig
symbol which takes care of that dependency.

Cc: "Rafał Miłecki" <zajec5@gmail.com>
Cc: <linux-wireless@vger.kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
drivers/net/wireless/brcm80211/Kconfig | 4 ++++
drivers/net/wireless/brcm80211/brcmsmac/Makefile | 2 +-
drivers/net/wireless/brcm80211/brcmsmac/led.h | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/Kconfig b/drivers/net/wireless/brcm80211/Kconfig
index b00a7e92225f..c9434b7c7b9b 100644
--- a/drivers/net/wireless/brcm80211/Kconfig
+++ b/drivers/net/wireless/brcm80211/Kconfig
@@ -16,6 +16,10 @@ config BRCMSMAC
be available if you select BCMA_DRIVER_GPIO. If you choose to build a
module, the driver will be called brcmsmac.ko.

+config BRCMSMAC_LED
+ def_bool y
+ depends on BRCMSMAC && BCMA_DRIVER_GPIO && LEDS_CLASS
+
config BRCMFMAC
tristate "Broadcom IEEE802.11n embedded FullMAC WLAN driver"
depends on CFG80211
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/Makefile b/drivers/net/wireless/brcm80211/brcmsmac/Makefile
index 32464acccd90..9ec2c8b2f26c 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/Makefile
+++ b/drivers/net/wireless/brcm80211/brcmsmac/Makefile
@@ -43,6 +43,6 @@ brcmsmac-y := \
brcms_trace_events.o \
debug.o

-brcmsmac-$(CONFIG_BCMA_DRIVER_GPIO) += led.o
+brcmsmac-$(CONFIG_BRCMSMAC_LED) += led.o

obj-$(CONFIG_BRCMSMAC) += brcmsmac.o
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/led.h b/drivers/net/wireless/brcm80211/brcmsmac/led.h
index 17a0b1f5dbcf..b914466e687b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/led.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/led.h
@@ -22,7 +22,7 @@ struct brcms_led {
bool active_low;
};

-#ifdef CONFIG_BCMA_DRIVER_GPIO
+#ifdef CONFIG_BRCMSMAC_LED
void brcms_led_unregister(struct brcms_info *wl);
int brcms_led_register(struct brcms_info *wl);
#else
--
1.8.4