use COMMAND_REGISTER macro
[fw/openocd] / src / jtag / at91rm9200.c
index 52869a3e53efb42a6786aa840a84bc6fc2f30974..024dd6d7ea25a78d50c7bd64291247b5e822f162 100644 (file)
@@ -118,11 +118,11 @@ static void at91rm9200_write(int tck, int tms, int tdi);
 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);
 
-jtag_interface_t at91rm9200_interface =
+struct jtag_interface at91rm9200_interface =
 {
        .name = "at91rm9200",
 
@@ -185,24 +185,24 @@ static int at91rm9200_speed(int speed)
        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 int at91rm9200_register_commands(struct command_context *cmd_ctx)
 {
-       register_command(cmd_ctx, NULL, "at91rm9200_device", at91rm9200_handle_device_command,
+       COMMAND_REGISTER(cmd_ctx, NULL, "at91rm9200_device", at91rm9200_handle_device_command,
                COMMAND_CONFIG, NULL);
        return ERROR_OK;
 }