diff mbox series

[v4,01/30] libpdbg: Do not assume device tree hierarchy

Message ID 20191003041909.23187-2-amitay@ozlabs.org
State Accepted
Headers show
Series Add system device tree to libpdbg | expand

Commit Message

Amitay Isaacs Oct. 3, 2019, 4:18 a.m. UTC
Always get the parent of required class explicitly.

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/p9chip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alistair Popple Oct. 9, 2019, 2:22 a.m. UTC | #1
Reviewed-by: Alistair Popple <alistair@popple.id.au>

On Thursday, 3 October 2019 2:18:40 PM AEDT Amitay Isaacs wrote:
> Always get the parent of required class explicitly.
> 
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  libpdbg/p9chip.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
> index f86a529..37cc93b 100644
> --- a/libpdbg/p9chip.c
> +++ b/libpdbg/p9chip.c
> @@ -80,14 +80,14 @@
>  
>  static uint64_t thread_read(struct thread *thread, uint64_t addr, uint64_t *data)
>  {
> -	struct pdbg_target *chip = require_target_parent(&thread->target);
> +	struct pdbg_target *chip = pdbg_target_require_parent("core", &thread->target);
>  
>  	return pib_read(chip, addr, data);
>  }
>  
>  static uint64_t thread_write(struct thread *thread, uint64_t addr, uint64_t data)
>  {
> -	struct pdbg_target *chip = require_target_parent(&thread->target);
> +	struct pdbg_target *chip = pdbg_target_require_parent("core", &thread->target);
>  
>  	return pib_write(chip, addr, data);
>  }
>
diff mbox series

Patch

diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index f86a529..37cc93b 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -80,14 +80,14 @@ 
 
 static uint64_t thread_read(struct thread *thread, uint64_t addr, uint64_t *data)
 {
-	struct pdbg_target *chip = require_target_parent(&thread->target);
+	struct pdbg_target *chip = pdbg_target_require_parent("core", &thread->target);
 
 	return pib_read(chip, addr, data);
 }
 
 static uint64_t thread_write(struct thread *thread, uint64_t addr, uint64_t data)
 {
-	struct pdbg_target *chip = require_target_parent(&thread->target);
+	struct pdbg_target *chip = pdbg_target_require_parent("core", &thread->target);
 
 	return pib_write(chip, addr, data);
 }