]> git.sur5r.net Git - openocd/commitdiff
allow jtag interfaces to lack commands
authorZachary T Welch <zw@superlucidity.net>
Sat, 21 Nov 2009 18:19:47 +0000 (10:19 -0800)
committerZachary T Welch <zw@superlucidity.net>
Sat, 21 Nov 2009 18:19:47 +0000 (10:19 -0800)
Allow JTAG interface drivers to skip registering an register_commands
callback when it will just be empty.

src/jtag/tcl.c

index 1266cd74e660c8a33e58af94185f62f30494285b..7307f64e3cf49ea695241e28c67a3db2fb058bde 100644 (file)
@@ -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];