[PATCH v2 3/7] of: dynamic: Don't discard children upon node attach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bjorn Andersson <quic_bjorande@xxxxxxxxxxx>

When dynamically modifying DeviceTree it's useful to be able to reparent
nodes, but of_attach_node() clear the child pointer and hence discards
any child nodes.

Retain the child pointer upon attach, so that the client code doesn't
need to manually rebuild the tree.

Current users of of_attach_node() either avoids attaching nodes with
children or explicitly attaches nodes without children, so no impact is
expected to current users.

Signed-off-by: Bjorn Andersson <quic_bjorande@xxxxxxxxxxx>
---
 drivers/of/dynamic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 110104a936d9..32e1dffd9f96 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -221,7 +221,6 @@ static void __of_attach_node(struct device_node *np)
 			np->phandle = 0;
 	}
 
-	np->child = NULL;
 	np->sibling = np->parent->child;
 	np->parent->child = np;
 	of_node_clear_flag(np, OF_DETACHED);

-- 
2.45.2





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux