From: Spencer Oliver Date: Wed, 12 May 2010 21:42:26 +0000 (+0100) Subject: flash: require unique flash bank name X-Git-Tag: v0.5.0-rc1~701 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c;p=openocd flash: require unique flash bank name Make sure the flash bank name is unique Signed-off-by: Spencer Oliver --- 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) {