From: Zachary T Welch Date: Sat, 21 Nov 2009 18:19:47 +0000 (-0800) Subject: allow jtag interfaces to lack commands X-Git-Tag: v0.4.0-rc1~466 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c46c2d77e63264a9f0187a477b77032d0ce6fcfa;p=openocd allow jtag interfaces to lack commands Allow JTAG interface drivers to skip registering an register_commands callback when it will just be empty. --- 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];