From c977616cdad17ad74742ede8703f54e370c3947d Mon Sep 17 00:00:00 2001 From: kc8apf Date: Mon, 18 May 2009 04:44:28 +0000 Subject: Consolidate target selection code into single get_target() that handles both names and numbers. Provided by David Brownell git-svn-id: svn://svn.berlios.de/openocd/trunk@1804 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/flash/flash.c') diff --git a/src/flash/flash.c b/src/flash/flash.c index 4f4d272a..ff66a396 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -261,9 +261,9 @@ static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cm return ERROR_COMMAND_SYNTAX_ERROR; } - if ((target = get_target_by_num(strtoul(args[5], NULL, 0))) == NULL) + if ((target = get_target(args[5])) == NULL) { - LOG_ERROR("target %lu not defined", strtoul(args[5], NULL, 0)); + LOG_ERROR("target '%s' not defined", args[5]); return ERROR_FAIL; } -- cgit v1.2.3-18-g5258