From 6dff2a9f3179b18806acff6694ff552558447b2e Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sat, 2 Jan 2021 19:22:10 +0100 Subject: [PATCH] target: target_error_check now defaults to not indicate error. Remove unneeded nop_function from efm32 --- src/target/efm32.c | 15 --------------- src/target/target.c | 6 ++++++ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/target/efm32.c b/src/target/efm32.c index 547eadc..4589c00 100644 --- a/src/target/efm32.c +++ b/src/target/efm32.c @@ -979,11 +979,6 @@ const struct command_s efm32_aap_cmd_list[] = { {NULL, NULL, NULL} }; -static bool nop_function(void) -{ - return true; -} - /** * AAP Probe */ @@ -1019,17 +1014,7 @@ void efm32_aap_probe(ADIv5_AP_t *ap) "EFM32 Authentication Access Port rev.%d", aap_revision); t->driver = priv_storage->aap_driver_string; - t->attach = (void*)nop_function; - t->detach = (void*)nop_function; - t->check_error = (void*)nop_function; - t->mem_read = (void*)nop_function; - t->mem_write = (void*)nop_function; t->regs_size = 4; - t->regs_read = (void*)nop_function; - t->regs_write = (void*)nop_function; - t->reset = (void*)nop_function; - t->halt_request = (void*)nop_function; - t->halt_resume = (void*)nop_function; target_add_commands(t, efm32_aap_cmd_list, t->driver); } diff --git a/src/target/target.c b/src/target/target.c index 44763ad..d356a9a 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -34,6 +34,11 @@ static bool nop_function(void) return true; } +static int null_function(void) +{ + return 0; +} + target *target_new(void) { target *t = (void*)calloc(1, sizeof(*t)); @@ -63,6 +68,7 @@ target *target_new(void) t->halt_request = (void*)nop_function; t->halt_poll = (void*)nop_function; t->halt_resume = (void*)nop_function; + t->check_error = (void*)null_function; t->target_storage = NULL;