aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2013-03-26 15:23:16 +0000
committerSpencer Oliver <spen@spen-soft.co.uk>2013-04-17 09:51:59 +0000
commit0a33b7b2aa25b8eba53c9097ac2c92c5be7f0227 (patch)
treee0fa13fdcc0109273af46705a4a7d92242c3065e /src
parent46bcaec696ae0974b47aeaea876737f13d0c55e5 (diff)
parport: fix parport_toggling_time regression
If parport_toggling_time is called before the adapter speed has been configured then the call fails. Probably not the best fix, but does at least enable parport_toggling_time to be used again. This regression was added in commit 740b9e25b410c164e661d0334a9ea4168406726b Change-Id: I90300916d6bda5ef053c557e5ac136c4f002bdd1 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1309 Tested-by: jenkins
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/parport.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c
index 793b28f3..7dd842e0 100644
--- a/src/jtag/drivers/parport.c
+++ b/src/jtag/drivers/parport.c
@@ -452,8 +452,13 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command)
parport_toggling_time_ns = ns;
retval = jtag_get_speed(&wait_states);
- if (retval != ERROR_OK)
- return retval;
+ if (retval != ERROR_OK) {
+ /* if jtag_get_speed fails then the clock_mode
+ * has not been configured, this happens if parport_toggling_time is
+ * called before the adapter speed is set */
+ LOG_INFO("no parport speed set - defaulting to zero wait states");
+ wait_states = 0;
+ }
}
command_print(CMD_CTX, "parport toggling time = %" PRIu32 " ns",