From 4a70eeffb023566b89b681b74b44785d3f902d84 Mon Sep 17 00:00:00 2001 From: zwelch Date: Tue, 2 Jun 2009 06:49:53 +0000 Subject: [PATCH] More JTAG interface driver cleanup: - Moves references to global jtag interface to default core implementation. - Missed this reference in the earlier "pointless" patch. Mea culpa. Important: this has a side-effect. Previously, the error return inside the interface routine short-circuited the remainder of that function when 'init' has not been called. With this patch, the command queue will be cleared in the case that 'init' has been called. Since that case indicates a buggy script, this does not seem to be a problem. git-svn-id: svn://svn.berlios.de/openocd/trunk@1995 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/jtag.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index b1c4dc61..682c1b33 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -1568,16 +1568,7 @@ void jtag_add_callback(jtag_callback1_t callback, u8 *in) int interface_jtag_execute_queue(void) { - int retval; - - if (jtag==NULL) - { - LOG_ERROR("No JTAG interface configured yet. Issue 'init' command in startup scripts before communicating with targets."); - return ERROR_FAIL; - } - - retval = default_interface_jtag_execute_queue(); - + int retval = default_interface_jtag_execute_queue(); if (retval == ERROR_OK) { struct jtag_callback_entry *entry; @@ -1598,6 +1589,14 @@ int interface_jtag_execute_queue(void) int default_interface_jtag_execute_queue(void) { + if (NULL == jtag) + { + LOG_ERROR("No JTAG interface configured yet. " + "Issue 'init' command in startup scripts " + "before communicating with targets."); + return ERROR_FAIL; + } + return jtag->execute_queue(); } -- 2.39.5