Browse Source

CMD: duplicate cmd error msg

When registering cmds we report duplicate attempts to register a cmd
as a LOG_ERROR.
Some situations need this, such as when registering dual flash banks.
http://www.mail-archive.com/openocd-development@lists.berlios.de/msg11152.html

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
tags/v0.4.0-rc2
Spencer Oliver 14 years ago
parent
commit
709f08f17a
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/helper/command.c

+ 4
- 1
src/helper/command.c View File

@@ -375,7 +375,10 @@ struct command* register_command(struct command_context *context,
struct command *c = command_find(*head, name); struct command *c = command_find(*head, name);
if (NULL != c) if (NULL != c)
{ {
LOG_ERROR("command '%s' is already registered in '%s' context",
/* TODO: originally we treated attempting to register a cmd twice as an error
* Sometimes we need this behaviour, such as with flash banks.
* http://www.mail-archive.com/openocd-development@lists.berlios.de/msg11152.html */
LOG_DEBUG("command '%s' is already registered in '%s' context",
name, parent ? parent->name : "<global>"); name, parent ? parent->name : "<global>");
return c; return c;
} }


Loading…
Cancel
Save