diff options
author | Alistair Popple <alistair@popple.id.au> | 2017-12-05 17:19:08 +1100 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2017-12-06 11:19:36 +1100 |
commit | 6b4b13bc13d0f49665113328a2657964ad905a77 (patch) | |
tree | 74674b6cd0bc628dda8ea45f04dae8dd5075aad3 | |
parent | 5373c4bee9eeb1c8fb91266e3fed581ace397666 (diff) | |
download | pdbg-6b4b13bc13d0f49665113328a2657964ad905a77.tar.gz pdbg-6b4b13bc13d0f49665113328a2657964ad905a77.zip |
libpdbg/target.c: Stop probing target multiple times
A lot of the device-tree parsing code was borrowed from Skiboot. This
includes dt_for_each_node() which iterates over all the child device-tree
nodes. It was incorrectly assumed this only iterated over direct children,
rather than every child in the tree. This lead to each target being probed
multiple times when the children were explicitly (and incorrectly) iterated
over.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
-rw-r--r-- | libpdbg/target.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libpdbg/target.c b/libpdbg/target.c index ebf41bb..74ad0bc 100644 --- a/libpdbg/target.c +++ b/libpdbg/target.c @@ -316,8 +316,7 @@ static void disable_node(struct dt_node *dn) static void _target_probe(struct dt_node *dn) { - int rc; - struct dt_node *next; + int rc = 0; struct dt_property *p; PR_DEBUG("Probe %s - ", dn->name); @@ -336,8 +335,6 @@ static void _target_probe(struct dt_node *dn) disable_node(dn); } else { PR_DEBUG("success\n"); - dt_for_each_child(dn, next) - _target_probe(next); } } |