static void at91rm9200_reset(int trst, int srst);
static int at91rm9200_speed(int speed);
-static int at91rm9200_register_commands(struct command_context_s *cmd_ctx);
+static int at91rm9200_register_commands(struct command_context *cmd_ctx);
static int at91rm9200_init(void);
static int at91rm9200_quit(void);
return ERROR_OK;
}
-static int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, char *cmd, char **CMD_ARGV, int argc)
{
- if (argc == 0)
+ if (CMD_ARGC == 0)
return ERROR_OK;
/* only if the device name wasn't overwritten by cmdline */
if (at91rm9200_device == 0)
{
- at91rm9200_device = malloc(strlen(args[0]) + sizeof(char));
- strcpy(at91rm9200_device, args[0]);
+ at91rm9200_device = malloc(strlen(CMD_ARGV[0]) + sizeof(char));
+ strcpy(at91rm9200_device, CMD_ARGV[0]);
}
return ERROR_OK;
}
-static int at91rm9200_register_commands(struct command_context_s *cmd_ctx)
+static const struct command_registration at91rm9200_command_handlers[] = {
+ {
+ .name = "at91rm9200_device",
+ .handler = &at91rm9200_handle_device_command,
+ .mode = COMMAND_CONFIG,
+ .help = "query armjtagew info",
+ },
+};
+
+static int at91rm9200_register_commands(struct command_context *cmd_ctx)
{
- register_command(cmd_ctx, NULL, "at91rm9200_device", at91rm9200_handle_device_command,
- COMMAND_CONFIG, NULL);
- return ERROR_OK;
+ return register_commands(cmd_ctx, NULL, at91rm9200_command_handlers);
}
static int at91rm9200_init(void)