]> git.sur5r.net Git - openocd/commitdiff
rename flash and nand command helpers
authorZachary T Welch <zw@superlucidity.net>
Tue, 17 Nov 2009 21:07:36 +0000 (13:07 -0800)
committerZachary T Welch <zw@superlucidity.net>
Thu, 19 Nov 2009 21:39:41 +0000 (13:39 -0800)
After adding support for referencing banks by name, renames
the COMMAND_HELPERs appropriately:
flash_command_get_bank_by_num  -> flash_command_get_bank
nand_command_get_device_by_num -> flash_command_get_device

13 files changed:
src/flash/avrf.c
src/flash/flash.c
src/flash/flash.h
src/flash/lpc2000.c
src/flash/lpc2900.c
src/flash/nand.c
src/flash/nand.h
src/flash/pic32mx.c
src/flash/stellaris.c
src/flash/stm32x.c
src/flash/str7x.c
src/flash/str9x.c
src/flash/str9xpec.c

index 20c619dce964f1dacf7af2491514b417e3592d56..356c404924a67e483c9c4682838f721101b5c2ae 100644 (file)
@@ -426,7 +426,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index 071503f162c360fe589ba1fce12e39455788e1d3..b960c64edd9d9c3295798f65c3084b4a8abc307f 100644 (file)
@@ -216,7 +216,7 @@ struct flash_bank *get_flash_bank_by_num(int num)
        return p;
 }
 
-COMMAND_HELPER(flash_command_get_bank_by_num, unsigned name_index,
+COMMAND_HELPER(flash_command_get_bank, unsigned name_index,
                struct flash_bank **bank)
 {
        const char *name = CMD_ARGV[name_index];
@@ -425,7 +425,7 @@ COMMAND_HANDLER(handle_flash_erase_check_command)
        }
 
        struct flash_bank *p;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
@@ -513,7 +513,7 @@ COMMAND_HANDLER(handle_flash_protect_check_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct flash_bank *p;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
@@ -837,7 +837,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
        duration_start(&bench);
 
        struct flash_bank *p;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
index fb88c35398a51321fc904051952798151d46cb44..1235a419ecf016469d4d8668a9833721ce9d22ac 100644 (file)
@@ -333,7 +333,7 @@ struct flash_bank *get_flash_bank_by_num(int num);
  * @param bank On output, contians a pointer to the bank or NULL.
  * @returns ERROR_OK on success, or an error indicating the problem.
  */
-COMMAND_HELPER(flash_command_get_bank_by_num, unsigned name_index,
+COMMAND_HELPER(flash_command_get_bank, unsigned name_index,
                struct flash_bank **bank);
 /**
  * Returns the flash bank like get_flash_bank_by_num(), without probing.
index 5442e712fde924fa81836bf785fda7762037dfe6..b60c6cfdeb4313228043f603bccf4e181a33c151 100644 (file)
@@ -749,7 +749,7 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index 1d5abd9d9ea7b7e12f74ddd1ab068da727ba9c56..465d77681529c7f3f18e2ee36523b73dc199ba5d 100644 (file)
@@ -544,7 +544,7 @@ COMMAND_HANDLER(lpc2900_handle_signature_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -589,7 +589,7 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -660,7 +660,7 @@ COMMAND_HANDLER(lpc2900_handle_password_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -695,7 +695,7 @@ COMMAND_HANDLER(lpc2900_handle_write_custom_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -806,7 +806,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_sector_command)
 
        /* Get the bank descriptor */
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -905,7 +905,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
 
        /* Get the bank descriptor */
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index d812805ab1ed885e2d96f3febb2e99d8ba8dd8f2..35180567b646693f7586aa7b8b1c136a8cb267c3 100644 (file)
@@ -322,7 +322,7 @@ struct nand_device *get_nand_device_by_num(int num)
        return NULL;
 }
 
-COMMAND_HELPER(nand_command_get_device_by_num, unsigned name_index,
+COMMAND_HELPER(nand_command_get_device, unsigned name_index,
                struct nand_device **nand)
 {
        const char *str = CMD_ARGV[name_index];
@@ -1100,7 +1100,7 @@ COMMAND_HANDLER(handle_nand_info_command)
        int last = -1;
 
        struct nand_device *p;
-       int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1175,7 +1175,7 @@ COMMAND_HANDLER(handle_nand_probe_command)
        }
 
        struct nand_device *p;
-       int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1204,7 +1204,7 @@ COMMAND_HANDLER(handle_nand_erase_command)
        }
 
        struct nand_device *p;
-       int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1263,7 +1263,7 @@ COMMAND_HANDLER(handle_nand_check_bad_blocks_command)
        }
 
        struct nand_device *p;
-       int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1415,7 +1415,7 @@ static COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct nand_device *nand;
-       int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &nand);
+       int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &nand);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1674,7 +1674,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
        }
 
        struct nand_device *p;
-       int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
+       int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &p);
        if (ERROR_OK != retval)
                return retval;
 
index a10877153169ef5689515cae2809f69928ae6d93..d38ed67ec9f9adff04071e7598e81eb76f8f33dd 100644 (file)
@@ -239,7 +239,7 @@ int nand_register_commands(struct command_context *cmd_ctx);
 int nand_init(struct command_context *cmd_ctx);
 
 /// helper for parsing a nand device command argument string
-COMMAND_HELPER(nand_command_get_device_by_num, unsigned name_index,
+COMMAND_HELPER(nand_command_get_device, unsigned name_index,
                struct nand_device **nand);
 
 
index 4bfe91b8b62455434db71ffafd4aae3494ac557a..fa5a4d67db1d7819be21cdbecae0f211ab12a618 100644 (file)
@@ -684,7 +684,7 @@ COMMAND_HANDLER(pic32mx_handle_lock_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -730,7 +730,7 @@ COMMAND_HANDLER(pic32mx_handle_unlock_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -820,7 +820,7 @@ COMMAND_HANDLER(pic32mx_handle_chip_erase_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -858,7 +858,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
        COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 2, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 2, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index a18c99b3b191ee8fc3ebd2f93ecd7c17d1edaddd..32fa415ee05bd6b831e5d1edf17ac3d0f817d601 100644 (file)
@@ -1139,7 +1139,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index 4db338d532e2a83920f79cf82c61433c86f3d8de..c96b49d74415b8da978fd78df9990bec405d5c2d 100644 (file)
@@ -905,7 +905,7 @@ COMMAND_HANDLER(stm32x_handle_lock_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -951,7 +951,7 @@ COMMAND_HANDLER(stm32x_handle_unlock_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -995,7 +995,7 @@ COMMAND_HANDLER(stm32x_handle_options_read_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1051,7 +1051,7 @@ COMMAND_HANDLER(stm32x_handle_options_write_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1160,7 +1160,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index da1899d50bc864223c6f2be3fd961be6daa25ff2..b79dd17fde37fcb25c57cd97514a3c597b9c1e63 100644 (file)
@@ -618,7 +618,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index 50cddaf2c430635b872a717ffc96df88f45842bb..3bb897057bfe93e908bdcb0ae60acf32741c59f7 100644 (file)
@@ -642,7 +642,7 @@ COMMAND_HANDLER(str9x_handle_flash_config_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
index de222fbf9bd15dfe4b9e914b3f1e819d4d6c3b94..f7c705e85bce6b07dfd03d86e37e7532df427539 100644 (file)
@@ -738,7 +738,7 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -789,7 +789,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_read_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -905,7 +905,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_write_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -928,7 +928,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -957,7 +957,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -986,7 +986,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1015,7 +1015,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1044,7 +1044,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_lock_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1067,7 +1067,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_unlock_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1093,7 +1093,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;
 
@@ -1140,7 +1140,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
        }
 
        struct flash_bank *bank;
-       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
+       int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
        if (ERROR_OK != retval)
                return retval;