From patchwork Tue Aug 20 07:19:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 1149839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46CMcL1wffz9s3Z for ; Tue, 20 Aug 2019 17:19:30 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=popple.id.au Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46CMcK64cKzDqfC for ; Tue, 20 Aug 2019 17:19:29 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46CMc30NgXzDqf2 for ; Tue, 20 Aug 2019 17:19:15 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=popple.id.au Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46CMc25K9mz9s00; Tue, 20 Aug 2019 17:19:14 +1000 (AEST) From: Alistair Popple To: pdbg@lists.ozlabs.org Date: Tue, 20 Aug 2019 17:19:04 +1000 Message-Id: <20190820071906.25950-3-alistair@popple.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190820071906.25950-1-alistair@popple.id.au> References: <20190820071906.25950-1-alistair@popple.id.au> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 3/5] device.c: Extend dt_expand to operate with different root nodes X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Alistair Popple Reviewed-by: Amitay Isaacs --- libpdbg/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpdbg/device.c b/libpdbg/device.c index 07f373d..2fcb184 100644 --- a/libpdbg/device.c +++ b/libpdbg/device.c @@ -574,11 +574,11 @@ static int dt_expand_node(struct pdbg_target *node, const void *fdt, int fdt_nod return nextoffset; } -static void dt_expand(const void *fdt) +static void dt_expand(void *root, const void *fdt) { PR_DEBUG("FDT: Parsing fdt @%p\n", fdt); - if (dt_expand_node(pdbg_dt_root, fdt, 0) < 0) + if (dt_expand_node(root, fdt, 0) < 0) abort(); } @@ -634,7 +634,7 @@ void pdbg_targets_init(void *fdt) return; } - dt_expand(fdt); + dt_expand(pdbg_dt_root, fdt); } char *pdbg_target_path(const struct pdbg_target *target)