use COMMAND_REGISTER macro
[fw/openocd] / src / jtag / at91rm9200.c
index 90d94c958b14245d4fb7a2510fdd8e6b07d387f0..024dd6d7ea25a78d50c7bd64291247b5e822f162 100644 (file)
@@ -185,7 +185,7 @@ static int at91rm9200_speed(int speed)
        return ERROR_OK;
 }
 
-static int at91rm9200_handle_device_command(struct command_context *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 (CMD_ARGC == 0)
                return ERROR_OK;
@@ -193,8 +193,8 @@ static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, cha
        /* 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;
@@ -202,7 +202,7 @@ static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, cha
 
 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;
 }