/* Read register */
int retval = mem_ap_read_atomic_u32(ap, self->spot.base + reg, &tmp);
- if (ERROR_OK != retval)
+ if (retval != ERROR_OK)
return retval;
/* clear bitfield */
COMMAND_REGISTRATION_DONE
};
-static int cti_configure(Jim_GetOptInfo *goi, struct arm_cti *cti)
+static int cti_configure(struct jim_getopt_info *goi, struct arm_cti *cti)
{
/* parse config or cget options ... */
while (goi->argc > 0) {
return JIM_OK;
}
-static int cti_create(Jim_GetOptInfo *goi)
+static int cti_create(struct jim_getopt_info *goi)
{
struct command_context *cmd_ctx;
static struct arm_cti *cti;
return JIM_ERR;
}
/* COMMAND */
- Jim_GetOpt_Obj(goi, &new_cmd);
+ jim_getopt_obj(goi, &new_cmd);
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
},
COMMAND_REGISTRATION_DONE
};
- e = register_commands(cmd_ctx, NULL, cti_commands);
- if (ERROR_OK != e)
+ e = register_commands_with_data(cmd_ctx, NULL, cti_commands, cti);
+ if (e != ERROR_OK)
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)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 2) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
"<name> [<cti_options> ...]");