[Pdbg] [PATCH v5 16/30] libpdbg: Probe should traverse virtual nodes also
Amitay Isaacs
amitay at ozlabs.org
Mon Oct 14 16:17:34 AEDT 2019
This ensures that the virtual nodes have correct status in the system
device tree view.
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/target.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/libpdbg/target.c b/libpdbg/target.c
index 627a44e..84aa510 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -360,7 +360,7 @@ struct pdbg_target_class *get_target_class(struct pdbg_target *target)
* exist but don't */
enum pdbg_target_status pdbg_target_probe(struct pdbg_target *target)
{
- struct pdbg_target *parent;
+ struct pdbg_target *parent, *vnode;
enum pdbg_target_status status;
assert(target);
@@ -374,7 +374,7 @@ enum pdbg_target_status pdbg_target_probe(struct pdbg_target *target)
* it's status won't have changed */
return status;
- parent = target->parent;
+ parent = get_parent(target, false);
if (parent) {
/* Recurse up the tree to probe and set parent target status */
pdbg_target_probe(parent);
@@ -406,6 +406,11 @@ enum pdbg_target_status pdbg_target_probe(struct pdbg_target *target)
}
}
+ /* Make sure any virtual nodes are also probed */
+ vnode = target_to_virtual(target, true);
+ if (vnode)
+ pdbg_target_probe(vnode);
+
/* At this point any parents must exist and have already been probed */
if (target->probe && target->probe(target)) {
/* Could not find the target */
--
2.21.0
More information about the Pdbg
mailing list