From c46c2d77e63264a9f0187a477b77032d0ce6fcfa Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Sat, 21 Nov 2009 10:19:47 -0800 Subject: [PATCH] allow jtag interfaces to lack commands Allow JTAG interface drivers to skip registering an register_commands callback when it will just be empty. --- src/jtag/tcl.c | 7 +++++-- 1 file 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]; -- 2.39.5