helper/command: pass command prefix to command registration
Replace the "struct command *parent" parameter with a string that contains the command prefix. This abstracts the openocd code from the knowledge of the tree of struct command. This also makes unused the function command_find_in_context(), so remove it. Change-Id: I598d60719cfdc1811ee6f6edfff8a116f82c7ed6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5668 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
@@ -1248,8 +1248,7 @@ static int flash_init_drivers(struct command_context *cmd_ctx)
|
||||
if (!flash_bank_list())
|
||||
return ERROR_OK;
|
||||
|
||||
struct command *parent = command_find_in_context(cmd_ctx, "flash");
|
||||
return register_commands(cmd_ctx, parent, flash_exec_command_handlers);
|
||||
return register_commands(cmd_ctx, "flash", flash_exec_command_handlers);
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_flash_bank_command)
|
||||
|
||||
Reference in New Issue
Block a user