]> git.gag.com Git - fw/openocd/blobdiff - src/flash/flash.c
add jim_handler to command_registration
[fw/openocd] / src / flash / flash.c
index 4584c5d03ee6f4fc958f4252d97383a22bd46ae8..bbdbaa8dc14e7c5025eb152b4af9e050d380cde5 100644 (file)
@@ -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[] = {