diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-10 22:23:07 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-13 10:51:46 -0800 |
commit | 5b6df55a1e5e4c0f531bc336691bc7c9a6a0df87 (patch) | |
tree | 50cd2c3812b1b585301e66fa4cd1fcc84e357539 /src/flash | |
parent | 1df5cc18f51366b823bccdaec4ffa1ee3fac2447 (diff) | |
download | riscv-openocd-5b6df55a1e5e4c0f531bc336691bc7c9a6a0df87.zip riscv-openocd-5b6df55a1e5e4c0f531bc336691bc7c9a6a0df87.tar.gz riscv-openocd-5b6df55a1e5e4c0f531bc336691bc7c9a6a0df87.tar.bz2 |
use CALL_COMMAND_HANDLER instead of direct calls
By using CALL_COMMAND_HANDLER, parameters can be reordered, added, or
even removed in inherited signatures, without requiring revisiting
all of the various call sites.
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/flash.c | 3 | ||||
-rw-r--r-- | src/flash/nand.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c index d3889b9..da43e1a 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -259,7 +259,8 @@ COMMAND_HANDLER(handle_flash_bank_command) c->sectors = NULL; c->next = NULL; - if ((retval = flash_drivers[i]->flash_bank_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK) + retval = CALL_COMMAND_HANDLER(flash_drivers[i]->flash_bank_command, c); + if (ERROR_OK != retval) { LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , args[0], c->base); free(c); diff --git a/src/flash/nand.c b/src/flash/nand.c index 181700d..88d3e42 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -241,7 +241,8 @@ COMMAND_HANDLER(handle_nand_device_command) c->use_raw = 0; c->next = NULL; - if ((retval = nand_flash_controllers[i]->nand_device_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK) + retval = CALL_COMMAND_HANDLER(nand_flash_controllers[i]->nand_device_command, c); + if (ERROR_OK != retval) { LOG_ERROR("'%s' driver rejected nand flash", c->controller->name); free(c); |