mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/2] of: Fix deep-probe triggering when removing nodes
Date: Fri, 25 Jun 2021 16:02:06 +0200	[thread overview]
Message-ID: <20210625140206.2000-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20210625140206.2000-1-s.hauer@pengutronix.de>

During deletion of device nodes of_find_device_by_node() is called in
order to set the device_node pointer of the device corresponding to
the to-be-deleted node to NULL. This is not necessary anymore as the
live tree should not be deleted.
This fixes problems with deep-probe support. of_find_device_by_node()
calls of_device_ensure_probed(), but this may only be called on the
live tree, not on arbitrary nodes that shall be deleted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/base.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 551b41fc9e..9a8fdc81e8 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2436,7 +2436,6 @@ void of_delete_node(struct device_node *node)
 {
 	struct device_node *n, *nt;
 	struct property *p, *pt;
-	struct device_d *dev;
 
 	if (!node)
 		return;
@@ -2457,10 +2456,6 @@ void of_delete_node(struct device_node *node)
 		list_del(&node->list);
 	}
 
-	dev = of_find_device_by_node(node);
-	if (dev)
-		dev->device_node = NULL;
-
 	free(node->name);
 	free(node->full_name);
 	free(node);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      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 [PATCH 1/2] of: refuse to delete root node of live tree Sascha Hauer
2021-06-25 14:02 ` Sascha Hauer [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20210625140206.2000-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH 2/2] of: Fix deep-probe triggering when removing nodes' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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