remove flash_driver->register_callbacks

Replace flash_driver callback with pointer to command_registration.
Eliminates all related routines and allows drivers to omit commands.
This commit is contained in:
Zachary T Welch
2009-11-22 06:12:04 -08:00
parent 6b9bb584a5
commit ad090413a8
17 changed files with 25 additions and 105 deletions

View File

@@ -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;