COMMAND_HANDLER(gw16012_handle_parport_port_command)
{
- if (argc == 1)
+ if (CMD_ARGC == 1)
{
/* only if the port wasn't overwritten by cmdline */
if (gw16012_port == 0)
{
- COMMAND_PARSE_NUMBER(u16, args[0], gw16012_port);
+ COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], gw16012_port);
}
else
{
}
}
- command_print(cmd_ctx, "parport port = %u", gw16012_port);
+ command_print(CMD_CTX, "parport port = %u", gw16012_port);
return ERROR_OK;
}
-static int gw16012_register_commands(struct command_context *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "parport_port",
- gw16012_handle_parport_port_command, COMMAND_CONFIG,
- NULL);
-
- return ERROR_OK;
-}
+static const struct command_registration gw16012_command_handlers[] = {
+ {
+ .name = "parport_port",
+ .handler = &gw16012_handle_parport_port_command,
+ .mode = COMMAND_CONFIG,
+ .help = "configure the parallel port to use",
+ .usage = "<port_num>",
+ },
+ COMMAND_REGISTRATION_DONE
+};
struct jtag_interface gw16012_interface = {
.name = "gw16012",
- .register_commands = &gw16012_register_commands,
+ .commands = gw16012_command_handlers,
.init = &gw16012_init,
.quit = &gw16012_quit,
.speed = &gw16012_speed,