diff options
author | Spencer Oliver <ntfreak@users.sourceforge.net> | 2010-05-12 22:42:26 +0100 |
---|---|---|
committer | Spencer Oliver <ntfreak@users.sourceforge.net> | 2010-05-13 20:44:07 +0100 |
commit | a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c (patch) | |
tree | a33354c26db63b5bf3a0e6819e2f50c6e48f498c | |
parent | 7b36d2a229ecde1a497773233ee1850bb10d80a7 (diff) | |
download | riscv-openocd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.zip riscv-openocd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.tar.gz riscv-openocd-a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c.tar.bz2 |
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index a3efd80..a6e942e 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) { |