[Pdbg] [PATCH 05/23] libpdbg: Support paths including virutal nodes

Alistair Popple alistair at popple.id.au
Thu Sep 19 13:10:23 AEST 2019


Agreed, certainly don't want different units returned based solely on which 
path is used.

Reviewed-by: Alistair Popple <alistair at popple.id.au>

On Thursday, 19 September 2019 12:33:15 PM AEST Amitay Isaacs wrote:
> With the presence of virtual nodes, some of the nodes can be reached
> from the root using different paths:
> 
>   - using virtual nodes (which provide the system device tree view)
>   - using the actual hwunits present in the backend (backend device tree)
> 
> Both device tree paths should result in the same hardware unit.
> 
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
>  libpdbg/device.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libpdbg/device.c b/libpdbg/device.c
> index 6e2e7bb..e4dc5c7 100644
> --- a/libpdbg/device.c
> +++ b/libpdbg/device.c
> @@ -294,7 +294,10 @@ static struct pdbg_target *dt_find_by_path(struct 
pdbg_target *root, const char
>  			if (pal && (pal != nal || strncmp(pa, na, pal)))
>  				match = false;
>  			if (match) {
> -				root = n;
> +				if (n->vnode)
> +					root = n->vnode;
> +				else
> +					root = n;
>  				break;
>  			}
>  		}
> 






More information about the Pdbg mailing list