diff mbox series

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

Message ID 20200610052426.150225-3-amitay@ozlabs.org
State Accepted
Headers show
Series Make kernel fsi driver generic | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (86851b290ac1771b9a6fb0d5238ebf459ea80a21)
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs June 10, 2020, 5:24 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/kernel.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Alistair Popple June 15, 2020, 7:26 a.m. UTC | #1
Technically this and the next patch should be rolled into one to avoid 
breaking anything.

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

On Wednesday, 10 June 2020 3:24:21 PM AEST Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay@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@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;
>
diff mbox series

Patch

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@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;