diff mbox series

[v2,06/15] main: Add explicit probing of selected targets

Message ID 20181109071011.253734-7-amitay@ozlabs.org
State Superseded
Headers show
Series Device tree path based targeting | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/snowpatch_job_snowpatch-pdbg success Test snowpatch/job/snowpatch-pdbg on branch master

Commit Message

Amitay Isaacs Nov. 9, 2018, 7:10 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 src/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Alistair Popple Nov. 13, 2018, 2:52 a.m. UTC | #1
I like it. More straight forward and less error prone than relying on each 
command to explicitly probe targets.

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

On Friday, 9 November 2018 6:10:02 PM AEDT Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  src/main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/main.c b/src/main.c
> index 9252eb3..3e3835c 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -775,6 +775,7 @@ int main(int argc, char *argv[])
>  	int i, rc = 0;
>  	void **args, **flags;
>  	optcmd_cmd_t *cmd;
> +	struct pdbg_target *target;
> 
>  	backend = default_backend();
> 
> @@ -793,6 +794,11 @@ int main(int argc, char *argv[])
>  	if (!target_selection())
>  		return 1;
> 
> +	/* Probe all selected targets */
> +	for_each_path_target(target) {
> +		pdbg_target_probe(target);
> +	}
> +
>  	atexit(atexit_release);
> 
>  	for (i = 0; i < ARRAY_SIZE(cmds); i++) {
diff mbox series

Patch

diff --git a/src/main.c b/src/main.c
index 9252eb3..3e3835c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -775,6 +775,7 @@  int main(int argc, char *argv[])
 	int i, rc = 0;
 	void **args, **flags;
 	optcmd_cmd_t *cmd;
+	struct pdbg_target *target;
 
 	backend = default_backend();
 
@@ -793,6 +794,11 @@  int main(int argc, char *argv[])
 	if (!target_selection())
 		return 1;
 
+	/* Probe all selected targets */
+	for_each_path_target(target) {
+		pdbg_target_probe(target);
+	}
+
 	atexit(atexit_release);
 
 	for (i = 0; i < ARRAY_SIZE(cmds); i++) {