]> git.sur5r.net Git - openocd/commitdiff
gw16012: use register_commands()
authorZachary T Welch <zw@superlucidity.net>
Sat, 21 Nov 2009 04:11:58 +0000 (20:11 -0800)
committerZachary T Welch <zw@superlucidity.net>
Wed, 25 Nov 2009 05:37:33 +0000 (21:37 -0800)
Use register_commands() with command registration array.

src/jtag/gw16012.c

index bc0e472480b019472e6f06875814880ef91e2698..0e495f924f6f99b6b916f49a8da1b25b2343b60a 100644 (file)
@@ -562,13 +562,20 @@ COMMAND_HANDLER(gw16012_handle_parport_port_command)
        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
+};
+
 static int gw16012_register_commands(struct command_context *cmd_ctx)
 {
-       COMMAND_REGISTER(cmd_ctx, NULL, "parport_port",
-                       gw16012_handle_parport_port_command, COMMAND_CONFIG,
-                       NULL);
-
-       return ERROR_OK;
+       return register_commands(cmd_ctx, NULL, gw16012_command_handlers);
 }
 
 struct jtag_interface gw16012_interface = {