aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/core/ofnode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index ec574c44607..1d4ab5bb6f2 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -60,6 +60,11 @@ static oftree oftree_ensure(void *fdt)
return oftree_null();
}
+ if (of_live_active()) {
+ log_err("Cannot register a flattree when OF_LIVE is active\n");
+ return oftree_null();
+ }
+
/* register the new tree */
i = oftree_count++;
oftree_list[i] = fdt;
@@ -133,6 +138,10 @@ oftree oftree_from_fdt(void *fdt)
if (CONFIG_IS_ENABLED(OFNODE_MULTI_TREE))
return oftree_ensure(fdt);
+#ifdef OF_CHECKS
+ if (of_live_active())
+ return oftree_null();
+#endif
tree.fdt = fdt;
return tree;