Message ID | 20200623063306.16876-1-alistair@popple.id.au |
---|---|
State | Accepted |
Headers | show |
Series | pdbg: Fix the scommable definition to work for any target attached to a pib | expand |
diff --git a/src/scom.c b/src/scom.c index 277f05c..1647b13 100644 --- a/src/scom.c +++ b/src/scom.c @@ -29,15 +29,8 @@ /* Check if a target has scom region */ static bool scommable(struct pdbg_target *target) { - const char *classname; - - classname = pdbg_target_class_name(target); - if (!strcmp(classname, "pib") || - !strcmp(classname, "core") || - !strcmp(classname, "thread")) - return true; - - return false; + return !strcmp(pdbg_target_class_name(target), "pib") || + !!pdbg_target_parent("pib", target); } int getscom(uint64_t addr)
Signed-off-by: Alistair Popple <alistair@popple.id.au> --- src/scom.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)