summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2017-12-05 17:19:08 +1100
committerAlistair Popple <alistair@popple.id.au>2017-12-06 11:19:36 +1100
commit6b4b13bc13d0f49665113328a2657964ad905a77 (patch)
tree74674b6cd0bc628dda8ea45f04dae8dd5075aad3
parent5373c4bee9eeb1c8fb91266e3fed581ace397666 (diff)
downloadpdbg-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.c5
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);
}
}
OpenPOWER on IntegriCloud