]> git.sur5r.net Git - openocd/commitdiff
Simplify jtag_add_sleep:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 8 Jun 2009 10:58:28 +0000 (10:58 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 8 Jun 2009 10:58:28 +0000 (10:58 +0000)
- Add todo for removing keep_alive: is this a layering violation?
- Use jtag_set_error instead of accessing jtag_error directly.
- Remove superfluous retval temporary variable and empty return.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2127 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/jtag.c

index f53bd26cf370e708bebe6145dd11f82ba04d1fa7..efc68f3d99110c9f7526b92b36565d9fb0aea988 100644 (file)
@@ -783,11 +783,9 @@ tap_state_t jtag_get_end_state(void)
 
 void jtag_add_sleep(u32 us)
 {
-       keep_alive(); /* we might be running on a very slow JTAG clk */
-       int retval=interface_jtag_add_sleep(us);
-       if (retval!=ERROR_OK)
-               jtag_error=retval;
-       return;
+       /// @todo Here, keep_alive() appears to be a layering violation!!!
+       keep_alive();
+       jtag_set_error(interface_jtag_add_sleep(us));
 }
 
 int jtag_check_value_inner(u8 *captured, u8 *in_check_value, u8 *in_check_mask, int num_bits)