Consolidate target selection code into single get_target() that handles both names and numbers. Provided by David Brownell <david-b@pacbell.net>

git-svn-id: svn://svn.berlios.de/openocd/trunk@1804 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
kc8apf
2009-05-18 04:44:28 +00:00
parent cafad4969c
commit c977616cda
15 changed files with 89 additions and 77 deletions

View File

@@ -210,9 +210,9 @@ int orion_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
}
device->controller_priv = hw;
hw->target = get_target_by_num(strtoul(args[1], NULL, 0));
hw->target = get_target(args[1]);
if (!hw->target) {
LOG_ERROR("no target '%s' configured", args[1]);
LOG_ERROR("target '%s' not defined", args[1]);
free(hw);
return ERROR_NAND_DEVICE_INVALID;
}