From 0a33b7b2aa25b8eba53c9097ac2c92c5be7f0227 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Tue, 26 Mar 2013 15:23:16 +0000 Subject: [PATCH] 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 Reviewed-on: http://openocd.zylin.com/1309 Tested-by: jenkins --- src/jtag/drivers/parport.c | 9 +++++++-- 1 file 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", -- 2.39.5