diff mbox series

[v1,26/30] discover: Add platform-dummy

Message ID 1e05792904c98bf7c1c2f9afb6d7dc46e1114b6a.1532469861.git.geoff@infradead.org
State Superseded
Headers show
Series [v1,01/30] docker: Add libfdt-dev | expand

Commit Message

Geoff Levand July 24, 2018, 10:15 p.m. UTC
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@infradead.org>
---
 discover/Makefile.am      |  3 +++
 discover/platform-dummy.c | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 discover/platform-dummy.c
diff mbox series

Patch

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);