From 45fb12f9b68b9d69a58fc41a0385aabef9769388 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 17 Jan 2020 12:21:09 +0100 Subject: [PATCH] cl-utils: Care for -j (JTAG) argument in test mode. --- src/platforms/pc/cl_utils.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/platforms/pc/cl_utils.c b/src/platforms/pc/cl_utils.c index 45d5ea6f..7905fa63 100644 --- a/src/platforms/pc/cl_utils.c +++ b/src/platforms/pc/cl_utils.c @@ -224,16 +224,8 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) { int res = -1; int num_targets; - if (opt->opt_mode == BMP_MODE_TEST) { + if (opt->opt_mode == BMP_MODE_TEST) printf("Running in Test Mode\n"); - num_targets = adiv5_swdp_scan(); - if (num_targets == 0) - num_targets = jtag_scan(NULL); - if (num_targets) - return 0; - else - return res; - } if (opt->opt_usejtag) { num_targets = jtag_scan(NULL); } else { @@ -243,6 +235,8 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) DEBUG("No target found\n"); return res; } + if (opt->opt_mode == BMP_MODE_TEST) + return 0; if (opt->opt_target_dev > num_targets) { DEBUG("Given target nummer %d not available\n", opt->opt_target_dev); return res;