diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-21 10:19:47 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-21 10:19:47 -0800 |
commit | c46c2d77e63264a9f0187a477b77032d0ce6fcfa (patch) | |
tree | 49be1d0bf9b62bc155cd5148f6d3d590d5d747fb /src | |
parent | 425e43d9d1f09a4de86eae89c91924ec98ef2de0 (diff) | |
download | openocd+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')
-rw-r--r-- | src/jtag/tcl.c | 7 |
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]; |