From 8c6ca8acc581fee5db9482985d291b4d5a6b67f7 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 --- common/state/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/state/state.c b/common/state/state.c index 0c329cd675..075618e5bb 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; -- cgit v1.2.3