Merge tag 'drm-vc4-fixes-2016-08-29' of https://github.com/anholt/linux into drm...
[deliverable/linux.git] / drivers / of / platform.c
index 765390e3ed8df39afced0c1233c194cb21899a6d..f39ccd5aa70125a1fc22529fff0b3de185aa5cd6 100644 (file)
@@ -497,14 +497,32 @@ int of_platform_default_populate(struct device_node *root,
 }
 EXPORT_SYMBOL_GPL(of_platform_default_populate);
 
+#ifndef CONFIG_PPC
 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;
 }
 arch_initcall_sync(of_platform_default_populate_init);
+#endif
 
 static int of_platform_device_destroy(struct device *dev, void *data)
 {
This page took 0.02642 seconds and 5 git commands to generate.