summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-11-25 16:38:08 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-11-25 16:38:08 -0800
commit2653b8030722c85393974cd6c0ebcdbd1ae27c72 (patch)
tree4cec04ac8f4f71678be236752b860724708144d8 /src/target/target.h
parentb715a81f5b95144118d8f946d4191f1dc844783a (diff)
downloadopenocd+libswd-2653b8030722c85393974cd6c0ebcdbd1ae27c72.tar.gz
openocd+libswd-2653b8030722c85393974cd6c0ebcdbd1ae27c72.tar.bz2
openocd+libswd-2653b8030722c85393974cd6c0ebcdbd1ae27c72.tar.xz
openocd+libswd-2653b8030722c85393974cd6c0ebcdbd1ae27c72.zip
target: create and use target_name()
Several of the sites now using target_type_name() really ought to be using an instance-specific name. Create a function called target_name(), accessing the instance's own (command) name. Use it in several places that really should be displaying instance-specific names. Also in several places which were already doing so, but which had no wrapper to call. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index 61bc68ae..15003c65 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -159,6 +159,12 @@ struct target
long long halt_issued_time; /* Note time when halt was issued */
};
+/** Returns the instance-specific name of the specified target. */
+static inline const char *target_name(struct target *target)
+{
+ return target->cmd_name;
+}
+
enum target_event
{
/* LD historical names