From 712d3fc0fb3ed69342a649d8bbb0d6d901a64720 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Mon, 9 Nov 2009 09:20:33 -0800 Subject: flash/.c: remove useless declarations Remove useless forward declarations. Moves command registrations to end of files. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch --- src/flash/stellaris.c | 59 +++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) (limited to 'src/flash/stellaris.c') diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index b482ce2e..bd561a61 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -34,39 +34,14 @@ #define DID0_VER(did0) ((did0 >> 28)&0x07) -static int stellaris_register_commands(struct command_context_s *cmd_ctx); -static int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -static int stellaris_erase(struct flash_bank_s *bank, int first, int last); -static int stellaris_protect(struct flash_bank_s *bank, int set, int first, int last); -static int stellaris_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count); -static int stellaris_auto_probe(struct flash_bank_s *bank); -static int stellaris_probe(struct flash_bank_s *bank); -static int stellaris_protect_check(struct flash_bank_s *bank); -static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size); static int stellaris_read_part_info(struct flash_bank_s *bank); static uint32_t stellaris_get_flash_status(flash_bank_t *bank); static void stellaris_set_flash_mode(flash_bank_t *bank,int mode); //static uint32_t stellaris_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout); -static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int stellaris_mass_erase(struct flash_bank_s *bank); -flash_driver_t stellaris_flash = -{ - .name = "stellaris", - .register_commands = stellaris_register_commands, - .flash_bank_command = stellaris_flash_bank_command, - .erase = stellaris_erase, - .protect = stellaris_protect, - .write = stellaris_write, - .probe = stellaris_probe, - .auto_probe = stellaris_auto_probe, - .erase_check = default_flash_mem_blank_check, - .protect_check = stellaris_protect_check, - .info = stellaris_info -}; - static struct { uint32_t partno; char *partname; @@ -264,14 +239,6 @@ static int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char return ERROR_OK; } -static int stellaris_register_commands(struct command_context_s *cmd_ctx) -{ - command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris", NULL, COMMAND_ANY, "stellaris flash specific commands"); - - register_command(cmd_ctx, stm32x_cmd, "mass_erase", stellaris_handle_mass_erase_command, COMMAND_EXEC, "mass erase device"); - return ERROR_OK; -} - static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size) { int printed, device_class; @@ -1192,3 +1159,29 @@ static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx return ERROR_OK; } + +static int stellaris_register_commands(struct command_context_s *cmd_ctx) +{ + command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris", + NULL, COMMAND_ANY, "stellaris flash specific commands"); + + register_command(cmd_ctx, stm32x_cmd, "mass_erase", + stellaris_handle_mass_erase_command, COMMAND_EXEC, + "mass erase device"); + return ERROR_OK; +} + + +flash_driver_t stellaris_flash = { + .name = "stellaris", + .register_commands = &stellaris_register_commands, + .flash_bank_command = &stellaris_flash_bank_command, + .erase = &stellaris_erase, + .protect = &stellaris_protect, + .write = &stellaris_write, + .probe = &stellaris_probe, + .auto_probe = &stellaris_auto_probe, + .erase_check = &default_flash_mem_blank_check, + .protect_check = &stellaris_protect_check, + .info = &stellaris_info, + }; -- cgit v1.2.3