aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 20:12:21 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:33 -0800
commitb1d034bf2f665cfa5633c8c6b46570d7ce6064a4 (patch)
treee1d9fa3a5649b01baf46e70d185a0ce03d5b07e4
parent779bdbe797b9c25b9f297b4f29500e847baf28c3 (diff)
downloadriscv-openocd-b1d034bf2f665cfa5633c8c6b46570d7ce6064a4.zip
riscv-openocd-b1d034bf2f665cfa5633c8c6b46570d7ce6064a4.tar.gz
riscv-openocd-b1d034bf2f665cfa5633c8c6b46570d7ce6064a4.tar.bz2
jlink: use register_commands()
Use register_commands() with command registration array.
-rw-r--r--src/jtag/jlink.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c
index 1ca9c39..24fb0e8 100644
--- a/src/jtag/jlink.c
+++ b/src/jtag/jlink.c
@@ -627,16 +627,26 @@ COMMAND_HANDLER(jlink_handle_jlink_hw_jtag_command)
return ERROR_OK;
}
+static const struct command_registration jlink_command_handlers[] = {
+ {
+ .name = "jlink_info",
+ .handler = &jlink_handle_jlink_info_command,
+ .mode = COMMAND_EXEC,
+ .help = "show jlink info",
+ },
+ {
+ .name = "jlink_hw_jtag",
+ .handler = &jlink_handle_jlink_hw_jtag_command,
+ .mode = COMMAND_EXEC,
+ .help = "access J-Link HW JTAG command version",
+ .usage = "[2|3]",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
static int jlink_register_commands(struct command_context *cmd_ctx)
{
-
- COMMAND_REGISTER(cmd_ctx, NULL, "jlink_info",
- &jlink_handle_jlink_info_command, COMMAND_EXEC,
- "query jlink info");
- COMMAND_REGISTER(cmd_ctx, NULL, "jlink_hw_jtag",
- &jlink_handle_jlink_hw_jtag_command, COMMAND_EXEC,
- "set/get jlink hw jtag command version [2 | 3]");
- return ERROR_OK;
+ return register_commands(cmd_ctx, NULL, jlink_command_handlers);
}
struct jtag_interface jlink_interface = {