forked from auracaster/openocd
flash: require unique flash bank name
Make sure the flash bank name is unique Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
This commit is contained in:
@@ -795,6 +795,14 @@ COMMAND_HANDLER(handle_flash_bank_command)
|
|||||||
return ERROR_FAIL;
|
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 */
|
/* register flash specific commands */
|
||||||
if (NULL != driver->commands)
|
if (NULL != driver->commands)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user