[PATCH v2 3/3] state: fix finding the correct parent node

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

 



Looking for the parent node during fixup is broken. The path of the parent
node is not correctly terminated ('0' vs '\0'). Also, the new state node
should be added to the supplied device tree not the barebox device tree
used by of_find_node_by_path().

Signed-off-by: Michael Olbrich <m.olbrich@xxxxxxxxxxxxxx>
---
 common/state/state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/state/state.c b/common/state/state.c
index 0c329cd67548..075618e5bb8f 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -307,8 +307,8 @@ static int of_state_fixup(struct device_node *root, void *ctx)
 		c = strrchr(of_path, '/');
 		if (!c)
 			return -ENODEV;
-		*c = '0';
-		parent = of_find_node_by_path(of_path);
+		*c = '\0';
+		parent = of_find_node_by_path_from(root, of_path);
 		if (!parent)
 			parent = root;
 
-- 
2.8.1


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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux