X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fpld%2Fpld.c;h=90067e34a6fc397f9a436a2e5370c5b6350b3ec2;hp=df7ac0de09cfad98cb680aa7f3f010d7258b3f8a;hb=46781080347af4f207cec108dfc2f96da61dcbfa;hpb=682910fdc24c8ae970b3cd1e5b4ff7042e0522be diff --git a/src/pld/pld.c b/src/pld/pld.c index df7ac0de09..90067e34a6 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -22,8 +22,8 @@ #endif #include "pld.h" -#include "log.h" -#include "time_support.h" +#include +#include /* pld drivers @@ -76,7 +76,7 @@ COMMAND_HANDLER(handle_pld_device_command) /* register pld specific commands */ int retval; if (pld_drivers[i]->commands) { - retval = register_commands(CMD_CTX, NULL, + retval = register_commands(CMD_CTX, NULL, pld_drivers[i]->commands); if (ERROR_OK != retval) { @@ -89,10 +89,12 @@ COMMAND_HANDLER(handle_pld_device_command) c->driver = pld_drivers[i]; c->next = NULL; - retval = CALL_COMMAND_HANDLER(pld_drivers[i]->pld_device_command, c); + retval = CALL_COMMAND_HANDLER( + pld_drivers[i]->pld_device_command, c); if (ERROR_OK != retval) { - LOG_ERROR("'%s' driver rejected pld device", CMD_ARGV[0]); + LOG_ERROR("'%s' driver rejected pld device", + CMD_ARGV[0]); free(c); return ERROR_OK; } @@ -191,20 +193,21 @@ COMMAND_HANDLER(handle_pld_load_command) static const struct command_registration pld_exec_command_handlers[] = { { .name = "devices", - .handler = &handle_pld_devices_command, + .handler = handle_pld_devices_command, .mode = COMMAND_EXEC, .help = "list configured pld devices", }, { .name = "load", - .handler = &handle_pld_load_command, + .handler = handle_pld_load_command, .mode = COMMAND_EXEC, .help = "load configuration file into PLD", - .usage = " ", + .usage = "pld_num filename", }, COMMAND_REGISTRATION_DONE }; -int pld_init(struct command_context *cmd_ctx) + +static int pld_init(struct command_context *cmd_ctx) { if (!pld_devices) return ERROR_OK; @@ -234,14 +237,14 @@ static const struct command_registration pld_config_command_handlers[] = { { .name = "device", .mode = COMMAND_CONFIG, - .handler = &handle_pld_device_command, + .handler = handle_pld_device_command, .help = "configure a PLD device", - .usage = " ...", + .usage = "driver_name [driver_args ... ]", }, { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_pld_init_command, + .handler = handle_pld_init_command, .help = "initialize PLD devices", }, COMMAND_REGISTRATION_DONE @@ -251,7 +254,6 @@ static const struct command_registration pld_command_handler[] = { .name = "pld", .mode = COMMAND_ANY, .help = "programmable logic device commands", - .chain = pld_config_command_handlers, }, COMMAND_REGISTRATION_DONE