summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-03-31 23:07:55 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-03-31 23:08:53 +0200
commite1f5055bb089d1f854777da1d200e7551cdd3a4f (patch)
treea5fc7982b2533b375dc0d6e741713193d0ad6fab
parentf169f86bd10c4dfdab6088e233647bb6d42b5c26 (diff)
downloadopenocd+libswd-e1f5055bb089d1f854777da1d200e7551cdd3a4f.tar.gz
openocd+libswd-e1f5055bb089d1f854777da1d200e7551cdd3a4f.tar.bz2
openocd+libswd-e1f5055bb089d1f854777da1d200e7551cdd3a4f.tar.xz
openocd+libswd-e1f5055bb089d1f854777da1d200e7551cdd3a4f.zip
mips: fix error handling for jtag_execute_queue()
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r--src/target/mips32_pracc.c6
-rw-r--r--src/target/mips_ejtag.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index 9a9b4272..0ee5715d 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -176,9 +176,7 @@ static int mips32_pracc_exec_read(struct mips32_pracc_context *ctx, uint32_t add
mips_ejtag_drscan_32(ctx->ejtag_info, &ejtag_ctrl);
jtag_add_clocks(5);
- jtag_execute_queue();
-
- return ERROR_OK;
+ return jtag_execute_queue();
}
static int mips32_pracc_exec_write(struct mips32_pracc_context *ctx, uint32_t address)
@@ -196,7 +194,7 @@ static int mips32_pracc_exec_write(struct mips32_pracc_context *ctx, uint32_t ad
mips_ejtag_drscan_32(ctx->ejtag_info, &ejtag_ctrl);
jtag_add_clocks(5);
- jtag_execute_queue();
+ return jtag_execute_queue();
if ((address >= MIPS32_PRACC_PARAM_IN)
&& (address <= MIPS32_PRACC_PARAM_IN + ctx->num_iparam * 4))
diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c
index e3810639..6ce702fd 100644
--- a/src/target/mips_ejtag.c
+++ b/src/target/mips_ejtag.c
@@ -64,11 +64,12 @@ int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info, uint32_t *idcode)
jtag_add_dr_scan(ejtag_info->tap, 1, &field, TAP_IDLE);
- if (jtag_execute_queue() != ERROR_OK)
+ int retval;
+ if ((retval = jtag_execute_queue()) != ERROR_OK)
{
LOG_ERROR("register read failed");
+ return retval;
}
-
return ERROR_OK;
}
@@ -84,11 +85,12 @@ static int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info, uint32_t *impco
jtag_add_dr_scan(ejtag_info->tap, 1, &field, TAP_IDLE);
- if (jtag_execute_queue() != ERROR_OK)
+ int retval;
+ if ((retval = jtag_execute_queue()) != ERROR_OK)
{
LOG_ERROR("register read failed");
+ return retval;
}
-
return ERROR_OK;
}