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 <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/532
Tested-by: jenkins
This commit is contained in:
Spencer Oliver 2012-03-19 16:38:11 +00:00
parent 1274df07f1
commit 4aa63d59bd
1 changed files with 9 additions and 8 deletions

View File

@ -117,15 +117,9 @@ int allow_transports(struct command_context *ctx, const char **vector)
if (!vector[1]) { if (!vector[1]) {
LOG_INFO("only one transport option; autoselect '%s'", vector[0]); LOG_INFO("only one transport option; autoselect '%s'", vector[0]);
return transport_select(ctx, 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__); LOG_DEBUG("%s", __func__);
if (!session) { if (!session) {
LOG_ERROR("session's transport is not selected."); 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; return ERROR_FAIL;
} }