flash: require unique flash bank name

Make sure the flash bank name is unique

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
__archive__
Spencer Oliver 2010-05-12 22:42:26 +01:00
parent 7b36d2a229
commit a7fb60dc7b
1 changed files with 8 additions and 0 deletions

View File

@ -795,6 +795,14 @@ COMMAND_HANDLER(handle_flash_bank_command)
return ERROR_FAIL;
}
/* check the flash bank name is unique */
if (get_flash_bank_by_name(bank_name) != NULL)
{
/* flash bank name already exists */
LOG_ERROR("flash bank name '%s' already exists", bank_name);
return ERROR_FAIL;
}
/* register flash specific commands */
if (NULL != driver->commands)
{