From a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Wed, 12 May 2010 22:42:26 +0100 Subject: flash: require unique flash bank name Make sure the flash bank name is unique Signed-off-by: Spencer Oliver --- src/flash/nor/tcl.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3