target/arm_adi_v5: Fix clear sticky overrun flag during replay of commands
[fw/openocd] / src / target / arm_cti.c
index 689e9df9fe75bb8bc1a3a0fca099102bf6dac443..ee9d8aafd40e920682d2a1e5384067ef4533d57f 100644 (file)
@@ -507,17 +507,13 @@ static int cti_create(Jim_GetOptInfo *goi)
                },
                COMMAND_REGISTRATION_DONE
        };
-       e = register_commands(cmd_ctx, NULL, cti_commands);
+       e = register_commands_with_data(cmd_ctx, NULL, cti_commands, cti);
        if (ERROR_OK != e)
                return JIM_ERR;
 
-       struct command *c = command_find_in_context(cmd_ctx, cp);
-       assert(c);
-       command_set_handler_data(c, cti);
-
        list_add_tail(&cti->lh, &all_cti);
 
-       return (ERROR_OK == e) ? JIM_OK : JIM_ERR;
+       return JIM_OK;
 }
 
 static int jim_cti_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)