summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer Oliver <ntfreak@users.sourceforge.net>2010-05-12 22:42:26 +0100
committerSpencer Oliver <ntfreak@users.sourceforge.net>2010-05-13 20:44:07 +0100
commita7fb60dc7b23a78be0ad5876b0e76a0e76875d5c (patch)
treea33354c26db63b5bf3a0e6819e2f50c6e48f498c
parent7b36d2a229ecde1a497773233ee1850bb10d80a7 (diff)
downloadopenocd+libswd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.tar.gz
openocd+libswd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.tar.bz2
openocd+libswd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.tar.xz
openocd+libswd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.zip
flash: require unique flash bank name
Make sure the flash bank name is unique Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
-rw-r--r--src/flash/nor/tcl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index a3efd805..a6e942e0 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -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)
{