summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-02 06:49:53 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-02 06:49:53 +0000
commit4a70eeffb023566b89b681b74b44785d3f902d84 (patch)
treeeef2faf7e9e53b0ab02bf49255da9d7425882a59 /src
parentc10d4d9a00e4074ce52524d5feace1fd0a4bce11 (diff)
downloadopenocd+libswd-4a70eeffb023566b89b681b74b44785d3f902d84.tar.gz
openocd+libswd-4a70eeffb023566b89b681b74b44785d3f902d84.tar.bz2
openocd+libswd-4a70eeffb023566b89b681b74b44785d3f902d84.tar.xz
openocd+libswd-4a70eeffb023566b89b681b74b44785d3f902d84.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/jtag/jtag.c19
1 files 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();
}