summaryrefslogtreecommitdiff
path: root/src/jtag/tcl.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-21 10:19:47 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-21 10:19:47 -0800
commitc46c2d77e63264a9f0187a477b77032d0ce6fcfa (patch)
tree49be1d0bf9b62bc155cd5148f6d3d590d5d747fb /src/jtag/tcl.c
parent425e43d9d1f09a4de86eae89c91924ec98ef2de0 (diff)
downloadopenocd_libswd-c46c2d77e63264a9f0187a477b77032d0ce6fcfa.tar.gz
openocd_libswd-c46c2d77e63264a9f0187a477b77032d0ce6fcfa.tar.bz2
openocd_libswd-c46c2d77e63264a9f0187a477b77032d0ce6fcfa.tar.xz
openocd_libswd-c46c2d77e63264a9f0187a477b77032d0ce6fcfa.zip
allow jtag interfaces to lack commands
Allow JTAG interface drivers to skip registering an register_commands callback when it will just be empty.
Diffstat (limited to 'src/jtag/tcl.c')
-rw-r--r--src/jtag/tcl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 1266cd74..7307f64e 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -636,9 +636,12 @@ COMMAND_HANDLER(handle_interface_command)
if (strcmp(CMD_ARGV[0], jtag_interfaces[i]->name) != 0)
continue;
- int retval = jtag_interfaces[i]->register_commands(CMD_CTX);
- if (ERROR_OK != retval)
+ if (NULL != jtag_interfaces[i]->register_commands)
+ {
+ int retval = jtag_interfaces[i]->register_commands(CMD_CTX);
+ if (ERROR_OK != retval)
return retval;
+ }
jtag_interface = jtag_interfaces[i];