summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-07-30 04:11:32 +0300
committerKees Cook <keescook@chromium.org>2016-08-05 21:21:36 +0300
commit529182e204db083cb7bda832d1c5c6d9278ba1cb (patch)
treeb923eedd4b5a1e2d6cdda1af5c8bfd3b18b17189 /drivers
parentf38d2e5313f0af9d9b66c02a5d49c71deb994b85 (diff)
downloadlinux-529182e204db083cb7bda832d1c5c6d9278ba1cb.tar.xz
ramoops: use DT reserved-memory bindings
Instead of a ramoops-specific node, use a child node of /reserved-memory. This requires that of_platform_device_create() be explicitly called for the node, though, since "/reserved-memory" does not have its own "compatible" property. Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/platform.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 765390e3ed8d..8aa197691074 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -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;
}