From ed99f90e6b2e30bea7e1cc55e8870054fb7410c1 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 16 Sep 2016 08:43:40 +0200 Subject: state: fix finding the correct parent node 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 Signed-off-by: Sascha Hauer --- src/barebox-state/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/barebox-state') diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c index d07f522..a993088 100644 --- a/src/barebox-state/state.c +++ b/src/barebox-state/state.c @@ -306,8 +306,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; -- cgit v1.2.3