From: Zachary T Welch Date: Sat, 21 Nov 2009 05:06:28 +0000 (-0800) Subject: vsllink: use register_commands() X-Git-Tag: v0.4.0-rc1~384 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fc2d9f87615b7a5562cb9cd58fb95953e5d89818;p=openocd vsllink: use register_commands() Use register_commands() with command registration array. --- diff --git a/src/jtag/vsllink.c b/src/jtag/vsllink.c index 3526198e..8287e84a 100644 --- a/src/jtag/vsllink.c +++ b/src/jtag/vsllink.c @@ -1856,28 +1856,43 @@ static void vsllink_debug_buffer(uint8_t *buffer, int length) } #endif // _DEBUG_USB_COMMS_ || _DEBUG_JTAG_IO_ +static const struct command_registration vsllink_command_handlers[] = { + { + .name = "vsllink_usb_vid", + .handler = &vsllink_handle_usb_vid_command, + .mode = COMMAND_CONFIG, + }, + { + .name = "vsllink_usb_pid", + .handler = &vsllink_handle_usb_pid_command, + .mode = COMMAND_CONFIG, + }, + { + .name = "vsllink_usb_bulkin", + .handler = &vsllink_handle_usb_bulkin_command, + .mode = COMMAND_CONFIG, + }, + { + .name = "vsllink_usb_bulkout", + .handler = &vsllink_handle_usb_bulkout_command, + .mode = COMMAND_CONFIG, + }, + { + .name = "vsllink_usb_interface", + .handler = &vsllink_handle_usb_interface_command, + .mode = COMMAND_CONFIG, + }, + { + .name = "vsllink_mode", + .handler = &vsllink_handle_mode_command, + .mode = COMMAND_CONFIG, + }, + COMMAND_REGISTRATION_DONE +}; + static int vsllink_register_commands(struct command_context *cmd_ctx) { - COMMAND_REGISTER(cmd_ctx, NULL, "vsllink_usb_vid", - vsllink_handle_usb_vid_command, COMMAND_CONFIG, - NULL); - COMMAND_REGISTER(cmd_ctx, NULL, "vsllink_usb_pid", - vsllink_handle_usb_pid_command, COMMAND_CONFIG, - NULL); - COMMAND_REGISTER(cmd_ctx, NULL, "vsllink_usb_bulkin", - vsllink_handle_usb_bulkin_command, COMMAND_CONFIG, - NULL); - COMMAND_REGISTER(cmd_ctx, NULL, "vsllink_usb_bulkout", - vsllink_handle_usb_bulkout_command, COMMAND_CONFIG, - NULL); - COMMAND_REGISTER(cmd_ctx, NULL, "vsllink_usb_interface", - vsllink_handle_usb_interface_command, COMMAND_CONFIG, - NULL); - COMMAND_REGISTER(cmd_ctx, NULL, "vsllink_mode", - vsllink_handle_mode_command, COMMAND_CONFIG, - NULL); - - return ERROR_OK; + return register_commands(cmd_ctx, NULL, vsllink_command_handlers); } struct jtag_interface vsllink_interface = {