[PATCH v2 27/30] discover: Add platform-dummy

Geoff Levand geoff at infradead.org
Fri Aug 3 03:29:40 AEST 2018


With the new configure enable-platform parameters it is possible
configure no platform support.  Add a new minimal 'dummy' platform
so that the __start_platforms and __stop_platforms variables needed
by platform_init are created.

Signed-off-by: Geoff Levand <geoff at infradead.org>
---
 discover/Makefile.am      |  3 +++
 discover/platform-dummy.c | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 discover/platform-dummy.c

diff --git a/discover/Makefile.am b/discover/Makefile.am
index 3992a66..f9625ec 100644
--- a/discover/Makefile.am
+++ b/discover/Makefile.am
@@ -86,6 +86,9 @@ discover_platform_ro_SOURCES = \
 discover_platform_ro_CPPFLAGS = \
 	$(AM_CPPFLAGS)
 
+# Build dummy last to put it at the end of the platforms section.
+discover_platform_ro_SOURCES += discover/platform-dummy.c
+
 if ENABLE_MTD
 discover_platform_ro_SOURCES += \
 	discover/hostboot.c
diff --git a/discover/platform-dummy.c b/discover/platform-dummy.c
new file mode 100644
index 0000000..7c2e1dc
--- /dev/null
+++ b/discover/platform-dummy.c
@@ -0,0 +1,16 @@
+#include "platform.h"
+
+static bool probe(struct platform *p, void *ctx)
+{
+	(void)p;
+	(void)ctx;
+
+	return false;
+}
+
+static struct platform dummy = {
+	.name			= "dummy",
+	.probe			= probe,
+};
+
+register_platform(dummy);
-- 
2.14.1




More information about the Petitboot mailing list