From 17a9dea53a71e9d7e241262725f3dd707b620d37 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Mon, 23 Nov 2009 15:03:04 -0800 Subject: 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. --- src/flash/flash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/flash') 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[] = { -- cgit v1.2.3