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__archive__
parent
1274df07f1
commit
4aa63d59bd
|
@ -117,16 +117,10 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to verify corrrect adapter driver initialization.
|
* Used to verify corrrect adapter driver initialization.
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue