summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-23 15:03:04 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:37 -0800
commit17a9dea53a71e9d7e241262725f3dd707b620d37 (patch)
tree863bbe082bfb4eeb61dcab0b952de506703391d6 /src/flash
parentcd7e76ebf0e09466aeb3c61498360c45a1a3ad39 (diff)
downloadopenocd_libswd-17a9dea53a71e9d7e241262725f3dd707b620d37.tar.gz
openocd_libswd-17a9dea53a71e9d7e241262725f3dd707b620d37.tar.bz2
openocd_libswd-17a9dea53a71e9d7e241262725f3dd707b620d37.tar.xz
openocd_libswd-17a9dea53a71e9d7e241262725f3dd707b620d37.zip
add jim_handler to command_registration
Adding jim_handler field to command_registration allows removing the register_jim helper. All command registrations now go through the register_command{,s}() functions.
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/flash.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 4584c5d0..bbdbaa8d 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -1368,8 +1368,6 @@ static const struct command_registration flash_exec_command_handlers[] = {
int flash_init_drivers(struct command_context *cmd_ctx)
{
- register_jim(cmd_ctx, "ocd_flash_banks",
- jim_flash_banks, "return information about the flash banks");
if (!flash_banks)
return ERROR_OK;
@@ -1377,7 +1375,6 @@ int flash_init_drivers(struct command_context *cmd_ctx)
return register_commands(cmd_ctx, parent, flash_exec_command_handlers);
}
-
static const struct command_registration flash_config_command_handlers[] = {
{
.name = "bank",
@@ -1389,6 +1386,12 @@ static const struct command_registration flash_config_command_handlers[] = {
.help = "Define a new bank with the given name, "
"using the specified NOR flash driver.",
},
+ {
+ .name = "banks",
+ .mode = COMMAND_ANY,
+ .jim_handler = &jim_flash_banks,
+ .help = "return information about the flash banks",
+ },
COMMAND_REGISTRATION_DONE
};
static const struct command_registration flash_command_handlers[] = {