diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-20 11:26:35 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-24 21:37:29 -0800 |
commit | 833e7f5248778bcb31b4db1a1b91160995415203 (patch) | |
tree | 7d5d5fa143b74f4989cc3226a0958e983cb1d2b5 /src/pld | |
parent | f7e1f2df74b599903a6fb2d2ace94c3f1ef06097 (diff) | |
download | riscv-openocd-833e7f5248778bcb31b4db1a1b91160995415203.zip riscv-openocd-833e7f5248778bcb31b4db1a1b91160995415203.tar.gz riscv-openocd-833e7f5248778bcb31b4db1a1b91160995415203.tar.bz2 |
use COMMAND_REGISTER macro
Replaces direct calls to register_command() with a macro, to allow
its parameters to be changed and callers updated in phases.
Diffstat (limited to 'src/pld')
-rw-r--r-- | src/pld/pld.c | 8 | ||||
-rw-r--r-- | src/pld/virtex2.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pld/pld.c b/src/pld/pld.c index d021f7b..021a8e6 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -189,10 +189,10 @@ int pld_init(struct command_context *cmd_ctx) if (!pld_devices) return ERROR_OK; - register_command(cmd_ctx, pld_cmd, "devices", + COMMAND_REGISTER(cmd_ctx, pld_cmd, "devices", handle_pld_devices_command, COMMAND_EXEC, "list configured pld devices"); - register_command(cmd_ctx, pld_cmd, "load", + COMMAND_REGISTER(cmd_ctx, pld_cmd, "load", handle_pld_load_command, COMMAND_EXEC, "load configuration <file> into programmable logic device"); @@ -201,9 +201,9 @@ int pld_init(struct command_context *cmd_ctx) int pld_register_commands(struct command_context *cmd_ctx) { - pld_cmd = register_command(cmd_ctx, NULL, "pld", NULL, COMMAND_ANY, "programmable logic device commands"); + pld_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "pld", NULL, COMMAND_ANY, "programmable logic device commands"); - register_command(cmd_ctx, pld_cmd, "device", handle_pld_device_command, COMMAND_CONFIG, NULL); + COMMAND_REGISTER(cmd_ctx, pld_cmd, "device", handle_pld_device_command, COMMAND_CONFIG, NULL); return ERROR_OK; } diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index e8fe63b..527434a 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -235,10 +235,10 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command) static int virtex2_register_commands(struct command_context *cmd_ctx) { - struct command *virtex2_cmd = register_command(cmd_ctx, NULL, "virtex2", + struct command *virtex2_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "virtex2", NULL, COMMAND_ANY, "virtex2 specific commands"); - register_command(cmd_ctx, virtex2_cmd, "read_stat", + COMMAND_REGISTER(cmd_ctx, virtex2_cmd, "read_stat", &virtex2_handle_read_stat_command, COMMAND_EXEC, "read Virtex-II status register"); |