[Pdbg] [PATCH v2 2/7] libpdbg: Do not hard-code fsi device path

Amitay Isaacs amitay at ozlabs.org
Wed Jun 10 15:24:21 AEST 2020


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/kernel.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c
index 7914e50..2cc81f2 100644
--- a/libpdbg/kernel.c
+++ b/libpdbg/kernel.c
@@ -147,12 +147,16 @@ int kernel_fsi_probe(struct pdbg_target *target)
 	int tries = 5;
 	int rc;
 	const char *kernel_path = kernel_get_fsi_path();
+	const char *fsi_path;
 	char *path;
 
 	if (!kernel_path)
 		return -1;
 
-	rc = asprintf(&path, "%s/fsi0/slave at 00:00/raw", kernel_get_fsi_path());
+	fsi_path = pdbg_target_property(target, "device-path", NULL);
+	assert(fsi_path);
+
+	rc = asprintf(&path, "%s%s", kernel_get_fsi_path(), fsi_path);
 	if (rc < 0) {
 		PR_ERROR("Unable create fsi path\n");
 		return rc;
-- 
2.26.2



More information about the Pdbg mailing list