nand/tcl: pass CMD to nand_list_walker()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Pass CMD instead of CMD_CTX as parameter to nand_list_walker().

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ia11887dfc6dc58d5458a88ba84780cd895b8c253
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5053
Tested-by: jenkins
bscan_optimization
Paul Fertser 2019-03-31 18:34:25 +02:00 committed by Tomas Vanek
parent dae5a32c05
commit 962267ba1a
1 changed files with 3 additions and 3 deletions

View File

@ -501,15 +501,15 @@ COMMAND_HANDLER(handle_nand_init_command)
static int nand_list_walker(struct nand_flash_controller *c, void *x) static int nand_list_walker(struct nand_flash_controller *c, void *x)
{ {
struct command_context *cmd_ctx = x; struct command_invocation *cmd = x;
command_print(cmd_ctx, " %s", c->name); command_print(cmd->ctx, " %s", c->name);
return ERROR_OK; return ERROR_OK;
} }
COMMAND_HANDLER(handle_nand_list_drivers) COMMAND_HANDLER(handle_nand_list_drivers)
{ {
command_print(CMD_CTX, "Available NAND flash controller drivers:"); command_print(CMD_CTX, "Available NAND flash controller drivers:");
return nand_driver_walk(&nand_list_walker, CMD_CTX); return nand_driver_walk(&nand_list_walker, CMD);
} }
static COMMAND_HELPER(create_nand_device, const char *bank_name, static COMMAND_HELPER(create_nand_device, const char *bank_name,