[PATCH 2/2] of: Fix deep-probe triggering when removing nodes

Sascha Hauer s.hauer at pengutronix.de
Fri Jun 25 07:02:06 PDT 2021


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 at 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




More information about the barebox mailing list