wifi: mt76: pass LED define via ccflags-y in driver submodules#1090
Open
mbc07 wants to merge 1 commit into
Open
wifi: mt76: pass LED define via ccflags-y in driver submodules#1090mbc07 wants to merge 1 commit into
mbc07 wants to merge 1 commit into
Conversation
Commit d2b01fb ("mt76: pass LED define via ccflags-y") converted the top-level Makefile from the deprecated EXTRA_CFLAGS to ccflags-y so that -DCONFIG_MT76_LEDS keeps working now that kbuild no longer honours EXTRA_CFLAGS. However, ccflags-y (like EXTRA_CFLAGS before it) only applies to the kbuild makefile it is set in and is not inherited by subdirectories pulled in via obj-y/obj-m. The mt7603, mt7615 and mt7915 driver subdirectories each set their own "EXTRA_CFLAGS += ... -DCONFIG_MT76_LEDS", which is now a silent no-op. As a result CONFIG_MT76_LEDS is undefined when building mt7603/init.c, mt7615/init.c, mt7615/pci_init.c and mt7915/init.c, the IS_ENABLED(CONFIG_MT76_LEDS) blocks are compiled out, and the mt76-* LED class devices are never registered for these drivers. Convert these subdirectory Makefiles to ccflags-y as well. mt7996/Makefile never carried the define at all, even though mt7996/init.c has the same IS_ENABLED(CONFIG_MT76_LEDS) checks for its LED callbacks and GPIO mux setup. Add ccflags-y there too so mt7996 LED support is enabled consistently with the other drivers. mt76x0, mt76x2, mt7921 and mt7925 contain no CONFIG_MT76_LEDS references and are left untouched. Fixes: d2b01fb ("mt76: pass LED define via ccflags-y") Link: openwrt#1077 Signed-off-by: Mateus B. Cassiano <mbc07@live.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #1077.
Completes the EXTRA_CFLAGS → ccflags-y migration for
-DCONFIG_MT76_LEDSthat was started in d2b01fb. That commit only touched the top-levelMakefile, butccflags-y/EXTRA_CFLAGSare scoped per kbuild makefile and aren't inherited by subdirectories.I tested this by compiling openwrt/openwrt@e4c35c2 with those changes for my D-Link DIR-882 A1 (has dual MT7615 radios); the
mt76-*LED class devices now correctly appear under/sys/class/leds, the same behavior reported earlier in #1077 (comment) with a different router (but also using MT7615 radios).The
mt7603,mt7915andmt7996changes are the same fix applied for consistency, but I don't have hardware to test those.mt7996in particular enables anIS_ENABLED(CONFIG_MT76_LEDS)code path that appears to have never been built with the define on before, so it'd be good if someone with that hardware could confirm it doesn't regress anything before merging. Alternatively, I can also drop themt7996change from this PR and leave only the others...