mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <>
To: Barebox List <>
Subject: [PATCH 1/2] of: refuse to delete root node of live tree
Date: Fri, 25 Jun 2021 16:02:05 +0200	[thread overview]
Message-ID: <> (raw)

The root node of the live tree should never be deleted, so refuse to do
so and print an error message. Deleting the live tree was possible with
the oftree -f command which was removed in c39c70bac5 ("commands: oftree:
kill oftree -f"). As this no longer exists we also do not need the
of_set_root_node(NULL) part anymore.

Signed-off-by: Sascha Hauer <>
 drivers/of/base.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5756f8b60a..551b41fc9e 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2441,6 +2441,11 @@ void of_delete_node(struct device_node *node)
 	if (!node)
+	if (node == root_node) {
+		pr_err("Won't delete root device node\n");
+		return;
+	}
 	list_for_each_entry_safe(p, pt, &node->properties, list)
@@ -2459,9 +2464,6 @@ void of_delete_node(struct device_node *node)
-	if (node == root_node)
-		of_set_root_node(NULL);
 struct device_node *of_get_stdoutpath(void)

barebox mailing list

             reply	other threads:[~2021-06-25 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 14:02 Sascha Hauer [this message]
2021-06-25 14:02 ` [PATCH 2/2] of: Fix deep-probe triggering when removing nodes Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: [PATCH 1/2] of: refuse to delete root node of live tree' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox