Merge tag 'pstore-v4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
[sfrench/cifs-2.6.git] / drivers / of / platform.c
index 765390e3ed8df39afced0c1233c194cb21899a6d..8aa19769107437b8d3bfada2d4fbd35b4b4fc297 100644 (file)
@@ -499,8 +499,24 @@ EXPORT_SYMBOL_GPL(of_platform_default_populate);
 
 static int __init of_platform_default_populate_init(void)
 {
-       if (of_have_populated_dt())
-               of_platform_default_populate(NULL, NULL, NULL);
+       struct device_node *node;
+
+       if (!of_have_populated_dt())
+               return -ENODEV;
+
+       /*
+        * Handle ramoops explicitly, since it is inside /reserved-memory,
+        * which lacks a "compatible" property.
+        */
+       node = of_find_node_by_path("/reserved-memory");
+       if (node) {
+               node = of_find_compatible_node(node, NULL, "ramoops");
+               if (node)
+                       of_platform_device_create(node, NULL, NULL);
+       }
+
+       /* Populate everything else. */
+       of_platform_default_populate(NULL, NULL, NULL);
 
        return 0;
 }