diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-22 06:12:04 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-24 21:37:35 -0800 |
commit | ad090413a8dfacccc993ff15b8376e0f2bd56712 (patch) | |
tree | 361fbbe3c90adaa54cb1c894ad108647224cdd3f /src/flash/flash.c | |
parent | 6b9bb584a5edec4889b12ed3f99a1e2eeab1ada2 (diff) |
remove flash_driver->register_callbacks
Replace flash_driver callback with pointer to command_registration.
Eliminates all related routines and allows drivers to omit commands.
Diffstat (limited to 'src/flash/flash.c')
-rw-r--r-- | src/flash/flash.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c index de95b62f..4584c5d0 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -263,15 +263,20 @@ COMMAND_HANDLER(handle_flash_bank_command) if (strcmp(driver_name, flash_drivers[i]->name) != 0) continue; - struct flash_bank *p, *c; - /* register flash specific commands */ - if (flash_drivers[i]->register_commands(CMD_CTX) != ERROR_OK) + if (NULL != flash_drivers[i]->commands) { - LOG_ERROR("couldn't register '%s' commands", driver_name); - return ERROR_FAIL; + int retval = register_commands(CMD_CTX, NULL, + flash_drivers[i]->commands); + if (ERROR_OK != retval) + { + LOG_ERROR("couldn't register '%s' commands", + driver_name); + return ERROR_FAIL; + } } + struct flash_bank *p, *c; c = malloc(sizeof(struct flash_bank)); c->name = strdup(bank_name); c->target = target; |