Skip to contentSkip to conversation

mt76: fix LED link time failure

PATCH In review Arnd Bergmann 3 participants 5 messages Dec 16, 2019 – Dec 18, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mt76: fix LED link time failure

The mt76_led_cleanup() function is called unconditionally, which leads to a link error when CONFIG_LEDS is a loadable module or disabled but mt76 is built-in:

drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_unregister_device':
mac80211.c:(.text+0x2ac): undefined reference to `led_classdev_unregister'

Use the same trick that is guarding the registration, using an IS_ENABLED() check for the CONFIG_MT76_LEDS symbol that indicates whether LEDs can be used or not.

Fixes 36f7e2b2bb1d ("mt76: do not use devm API for led classdev")
---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mac80211.c +2 -1
index b9f2a401041a..96018fd65779 100644
@@ -378,7 +378,8 @@ void mt76_unregister_device(struct mt76_dev *dev)
 {
 	struct ieee80211_hw *hw = dev->hw;
 
-	mt76_led_cleanup(dev);
+	if (IS_ENABLED(CONFIG_MT76_LEDS))
+		mt76_led_cleanup(dev);
 	mt76_tx_status_check(dev, NULL, true);
 	ieee80211_unregister_hw(hw);
 }
Signature · 1 line
2.20.0
#1 lore raw
Quoted 7 lines · Arnd Bergmann

The mt76_led_cleanup() function is called unconditionally, which leads to a link error when CONFIG_LEDS is a loadable module or disabled but mt76 is built-in:

drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_unregister_device':
mac80211.c:(.text+0x2ac): undefined reference to `led_classdev_unregister'

Quoted 6 lines

Use the same trick that is guarding the registration, using an IS_ENABLED() check for the CONFIG_MT76_LEDS symbol that indicates whether LEDs can be used or not.

Fixes 36f7e2b2bb1d ("mt76: do not use devm API for led classdev")

Felix, as this is a regression in v5.5-rc1 can I take this directly to wireless-drivers?

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
maintainer Acked-by
#2 lore raw
Quoted 13 lines · Kalle Valo
Quoted 11 lines · Arnd Bergmann

The mt76_led_cleanup() function is called unconditionally, which leads to a link error when CONFIG_LEDS is a loadable module or disabled but mt76 is built-in:

drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_unregister_device':
mac80211.c:(.text+0x2ac): undefined reference to `led_classdev_unregister'

Use the same trick that is guarding the registration, using an IS_ENABLED() check for the CONFIG_MT76_LEDS symbol that indicates whether LEDs can be used or not.

Quoted 5 lines
Quoted 2 lines
Fixes 36f7e2b2bb1d ("mt76: do not use devm API for led classdev")

Felix, as this is a regression in v5.5-rc1 can I take this directly to wireless-drivers?

Yes. Please add:

- Felix

#3 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

The mt76_led_cleanup() function is called unconditionally, which leads to a link error when CONFIG_LEDS is a loadable module or disabled but mt76 is built-in:

drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_unregister_device':
mac80211.c:(.text+0x2ac): undefined reference to `led_classdev_unregister'

Quoted 7 lines

Use the same trick that is guarding the registration, using an IS_ENABLED() check for the CONFIG_MT76_LEDS symbol that indicates whether LEDs can be used or not.

Fixes 36f7e2b2bb1d ("mt76: do not use devm API for led classdev")

Patch applied to wireless-drivers.git, thanks.

d68f4e43a46f mt76: fix LED link time failure

Signature · 3 lines
https://patchwork.kernel.org/patch/11294195/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#4 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

The mt76_led_cleanup() function is called unconditionally, which leads to a link error when CONFIG_LEDS is a loadable module or disabled but mt76 is built-in:

drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_unregister_device':
mac80211.c:(.text+0x2ac): undefined reference to `led_classdev_unregister'

Quoted 7 lines

Use the same trick that is guarding the registration, using an IS_ENABLED() check for the CONFIG_MT76_LEDS symbol that indicates whether LEDs can be used or not.

Fixes 36f7e2b2bb1d ("mt76: do not use devm API for led classdev")

Patch applied to wireless-drivers.git, thanks.

d68f4e43a46f mt76: fix LED link time failure

Signature · 8 lines
https://patchwork.kernel.org/patch/11294195/

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

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel