discover: Add platform-dummy
authorGeoff Levand <geoff@infradead.org>
Thu, 2 Aug 2018 17:29:40 +0000 (17:29 +0000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 7 Aug 2018 01:30:36 +0000 (11:30 +1000)
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>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/Makefile.am
discover/platform-dummy.c [new file with mode: 0644]

index 3992a6659b3e7c5426b1a0be4c8b7e03b1a6bcf1..f9625ec400b42811190ef2f31043371361714062 100644 (file)
@@ -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 (file)
index 0000000..7c2e1dc
--- /dev/null
@@ -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);