[v2,27/30] discover: Add platform-dummy
diff mbox series

Message ID 79b9b18150add1e833f3fcffea3fc5c788647d09.1533230644.git.geoff@infradead.org
State Accepted
Headers show
Series
  • [v2,01/30] docker: Add libfdt-dev
Related show

Commit Message

Geoff Levand Aug. 2, 2018, 5:29 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

Patch
diff mbox series

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