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.
This commit is contained in:
@@ -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[] = {
|
||||
|
||||
Reference in New Issue
Block a user