Skip to contentSkip to conversation

misc: Fix always compiling MISC even for SPL/TPL

PATCH In review Sean Anderson 2 participants 2 messages Apr 22, 2022 – May 10, 2022 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 misc: Fix always compiling MISC even for SPL/TPL

We should only build support for misc if the appropriate SPL/TPL symbol is defined. To ease the transition, make SPL/TPL_MISC default to MISC. This is necessary because many drivers don't specify their dependencies properly. These defaults can be removed once all drivers depend on the appropriate config.

Fixes aaba703fd0 ("spl: misc: Allow misc drivers in SPL and TPL")

---

Changes in v2:
- Make SPL/TPL_MISC default to MISC

 drivers/misc/Kconfig  | 2 ++
 drivers/misc/Makefile | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/misc/Kconfig +2 -0
index 10fd601278..21b334d43d 100644
@@ -16,6 +16,7 @@ config MISC
 config SPL_MISC
 	bool "Enable Driver Model for Misc drivers in SPL"
 	depends on SPL_DM
+	default MISC
 	help
 	  Enable driver model for miscellaneous devices. This class is
 	  used only for those do not fit other more general classes. A
@@ -25,6 +26,7 @@ config SPL_MISC
 config TPL_MISC
 	bool "Enable Driver Model for Misc drivers in TPL"
 	depends on TPL_DM
+	default MISC
 	help
 	  Enable driver model for miscellaneous devices. This class is
 	  used only for those do not fit other more general classes. A
drivers/misc/Makefile +1 -1
index 6150d01e88..7a6047f64f 100644
@@ -3,7 +3,7 @@
 # (C) Copyright 2000-2007
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 
-obj-$(CONFIG_MISC) += misc-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)MISC) += misc-uclass.o
 
 obj-$(CONFIG_$(SPL_TPL_)CROS_EC) += cros_ec.o
 obj-$(CONFIG_$(SPL_TPL_)CROS_EC_SANDBOX) += cros_ec_sandbox.o
Signature · 1 line
2.35.1.1320.gc452695387.dirty
#1 lore raw
Quoted 8 lines · Sean Anderson

We should only build support for misc if the appropriate SPL/TPL symbol is defined. To ease the transition, make SPL/TPL_MISC default to MISC. This is necessary because many drivers don't specify their dependencies properly. These defaults can be removed once all drivers depend on the appropriate config.

Fixes aaba703fd0 ("spl: misc: Allow misc drivers in SPL and TPL")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom