summaryrefslogtreecommitdiff
path: root/src/target/xscale.c
diff options
context:
space:
mode:
authorkc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-18 04:44:28 +0000
committerkc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-18 04:44:28 +0000
commitc977616cdad17ad74742ede8703f54e370c3947d (patch)
tree353069e20f067f73c3eba780cc53c393b26947c1 /src/target/xscale.c
parentcafad4969c306c87954c8bd681068932dae68a41 (diff)
downloadopenocd_libswd-c977616cdad17ad74742ede8703f54e370c3947d.tar.gz
openocd_libswd-c977616cdad17ad74742ede8703f54e370c3947d.tar.bz2
openocd_libswd-c977616cdad17ad74742ede8703f54e370c3947d.tar.xz
openocd_libswd-c977616cdad17ad74742ede8703f54e370c3947d.zip
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
Diffstat (limited to 'src/target/xscale.c')
-rw-r--r--src/target/xscale.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/target/xscale.c b/src/target/xscale.c
index abdbe866..3947da0b 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -3147,9 +3147,9 @@ int xscale_handle_debug_handler_command(struct command_context_s *cmd_ctx, char
return ERROR_OK;
}
- if ((target = get_target_by_num(strtoul(args[0], NULL, 0))) == NULL)
+ if ((target = get_target(args[0])) == NULL)
{
- LOG_ERROR("no target '%s' configured", args[0]);
+ LOG_ERROR("target '%s' not defined", args[0]);
return ERROR_FAIL;
}
@@ -3187,9 +3187,10 @@ int xscale_handle_cache_clean_address_command(struct command_context_s *cmd_ctx,
return ERROR_COMMAND_SYNTAX_ERROR;
}
- if ((target = get_target_by_num(strtoul(args[0], NULL, 0))) == NULL)
+ target = get_target(args[0]);
+ if (target == NULL)
{
- LOG_ERROR("no target '%s' configured", args[0]);
+ LOG_ERROR("target '%s' not defined", args[0]);
return ERROR_FAIL;
}