]> git.sur5r.net Git - openocd/commitdiff
mips: fix error handling for jtag_execute_queue()
authorØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 31 Mar 2011 21:07:55 +0000 (23:07 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 31 Mar 2011 21:08:53 +0000 (23:08 +0200)
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/target/mips32_pracc.c
src/target/mips_ejtag.c

index 9a9b42723565cb732c8b29ba839be6dc40e9e1d7..0ee5715dd299811cbc7d991053068f709f9635d6 100644 (file)
@@ -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))
index e3810639ce81b474e63f200e6a0b4420118e2c7b..6ce702fdbb0c43e07809c97db49b5b06a64c4250 100644 (file)
@@ -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;
 }