From 4aa63d59bd9c8a98cfa547cd6d6f477a84c146ee Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Mon, 19 Mar 2012 16:38:11 +0000 Subject: [PATCH] transport: remove interface multiple transport warning Currently if we have multiple transport's defined we receive an warning similar to: must select a transport. allow transport 'jtag' allow transport 'swd This removes that warning and only prints this info if transport_init fails. Change-Id: I87126390f234bc2f705e1f150a0dcc110dcab151 Signed-off-by: Spencer Oliver Reviewed-on: http://openocd.zylin.com/532 Tested-by: jenkins --- src/transport/transport.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/transport/transport.c b/src/transport/transport.c index 59f49a98..2f359657 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -117,15 +117,9 @@ int allow_transports(struct command_context *ctx, const char **vector) if (!vector[1]) { LOG_INFO("only one transport option; autoselect '%s'", vector[0]); return transport_select(ctx, vector[0]); - } else { - /* guard against user config errors */ - LOG_WARNING("must select a transport."); - while (*vector) { - LOG_DEBUG("allow transport '%s'", *vector); - vector++; - } - return ERROR_OK; } + + return ERROR_OK; } /** @@ -246,6 +240,13 @@ COMMAND_HANDLER(handle_transport_init) LOG_DEBUG("%s", __func__); if (!session) { LOG_ERROR("session's transport is not selected."); + + /* no session transport configured, print transports then fail */ + const char **vector = allowed_transports; + while (*vector) { + LOG_ERROR("allow transport '%s'", *vector); + vector++; + } return ERROR_FAIL; } -- 2.39.5