Simplify jtag_add_dr_scan:
[fw/openocd] / src / target / etm_dummy.c
index 9acf38fecd48fd3427a9c24eaa472718f5c360ac..4b84fd32061b64279e424f2e848c703e20fe00ca 100644 (file)
 #include "config.h"
 #endif
 
-#include <string.h>
-
 #include "etm_dummy.h"
-#include "etm.h"
-
 #include "arm7_9_common.h"
-#include "log.h"
-#include "types.h"
-#include "binarybuffer.h"
-#include "target.h"
-#include "register.h"
-#include "jtag.h"
 
-#include <stdlib.h>
 
-int handle_etm_dummy_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_etm_dummy_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
        target_t *target;
        armv4_5_common_t *armv4_5;
        arm7_9_common_t *arm7_9;
 
-       target = get_target_by_num(strtoul(args[0], NULL, 0));
+       target = get_target(args[0]);
 
        if (!target)
        {
-               LOG_ERROR("target number '%s' not defined", args[0]);
+               LOG_ERROR("target '%s' not defined", args[0]);
                return ERROR_FAIL;
        }
 
@@ -69,7 +58,7 @@ int handle_etm_dummy_config_command(struct command_context_s *cmd_ctx, char *cmd
        return ERROR_OK;
 }
 
-int etm_dummy_register_commands(struct command_context_s *cmd_ctx)
+static int etm_dummy_register_commands(struct command_context_s *cmd_ctx)
 {
        command_t *etm_dummy_cmd;
 
@@ -80,27 +69,27 @@ int etm_dummy_register_commands(struct command_context_s *cmd_ctx)
        return ERROR_OK;
 }
 
-int etm_dummy_init(etm_context_t *etm_ctx)
+static int etm_dummy_init(etm_context_t *etm_ctx)
 {
        return ERROR_OK;
 }
 
-trace_status_t etm_dummy_status(etm_context_t *etm_ctx)
+static trace_status_t etm_dummy_status(etm_context_t *etm_ctx)
 {
        return TRACE_IDLE;
 }
 
-int etm_dummy_read_trace(etm_context_t *etm_ctx)
+static int etm_dummy_read_trace(etm_context_t *etm_ctx)
 {
        return ERROR_OK;
 }
 
-int etm_dummy_start_capture(etm_context_t *etm_ctx)
+static int etm_dummy_start_capture(etm_context_t *etm_ctx)
 {
        return ERROR_ETM_PORTMODE_NOT_SUPPORTED;
 }
 
-int etm_dummy_stop_capture(etm_context_t *etm_ctx)
+static int etm_dummy_stop_capture(etm_context_t *etm_ctx)
 {
        return ERROR_OK;
 }