nand/tcl: pass CMD to nand_list_walker() 53/5053/2
authorPaul Fertser <fercerpav@gmail.com>
Sun, 31 Mar 2019 16:34:25 +0000 (18:34 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Tue, 14 May 2019 18:33:51 +0000 (19:33 +0100)
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
src/flash/nand/tcl.c

index 5e8b46e..8a7022a 100644 (file)
@@ -501,15 +501,15 @@ COMMAND_HANDLER(handle_nand_init_command)
 
 static int nand_list_walker(struct nand_flash_controller *c, void *x)
 {
-       struct command_context *cmd_ctx = x;
-       command_print(cmd_ctx, "  %s", c->name);
+       struct command_invocation *cmd = x;
+       command_print(cmd->ctx, "  %s", c->name);
        return ERROR_OK;
 }
 
 COMMAND_HANDLER(handle_nand_list_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,