diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-09 23:20:34 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-11 11:53:22 -0800 |
commit | 39ab1c1a41cf6adfaeb936931a771e6b2d5fbdcb (patch) | |
tree | bd3b863ba2f019b26f16cacce6fc31caf17dbf1a /src/pld/pld.c | |
parent | e9974316027097ff7984924676d70d33b7b674ed (diff) |
remove more useless declarations
Removes forward declarations by moving command registration after
defintion of the command handlers.
Diffstat (limited to 'src/pld/pld.c')
-rw-r--r-- | src/pld/pld.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/pld/pld.c b/src/pld/pld.c index 2bfb4016..df7e2fda 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -39,26 +39,6 @@ static pld_driver_t *pld_drivers[] = static pld_device_t *pld_devices; static command_t *pld_cmd; -static int handle_pld_devices_command(struct command_context_s *cmd_ctx, - char *cmd, char **args, int argc); -static int handle_pld_device_command(struct command_context_s *cmd_ctx, - char *cmd, char **args, int argc); -static int handle_pld_load_command(struct command_context_s *cmd_ctx, - char *cmd, char **args, int argc); - -int pld_init(struct command_context_s *cmd_ctx) -{ - if (pld_devices) - { - register_command(cmd_ctx, pld_cmd, "devices", handle_pld_devices_command, COMMAND_EXEC, - "list configured pld devices"); - register_command(cmd_ctx, pld_cmd, "load", handle_pld_load_command, COMMAND_EXEC, - "load configuration <file> into programmable logic device"); - } - - return ERROR_OK; -} - pld_device_t *get_pld_device_by_num(int num) { pld_device_t *p; @@ -206,6 +186,21 @@ static int handle_pld_load_command(struct command_context_s *cmd_ctx, return ERROR_OK; } +int pld_init(struct command_context_s *cmd_ctx) +{ + if (!pld_devices) + return ERROR_OK; + + register_command(cmd_ctx, pld_cmd, "devices", + handle_pld_devices_command, COMMAND_EXEC, + "list configured pld devices"); + register_command(cmd_ctx, pld_cmd, "load", + handle_pld_load_command, COMMAND_EXEC, + "load configuration <file> into programmable logic device"); + + return ERROR_OK; +} + int pld_register_commands(struct command_context_s *cmd_ctx) { pld_cmd = register_command(cmd_ctx, NULL, "pld", NULL, COMMAND_ANY, "programmable logic device commands"); |