diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-10-23 01:13:19 -0700 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-05 18:03:20 -0800 |
commit | 11e545f56091e4fa808bd57a215d6b8066b39295 (patch) | |
tree | c60d0c44f7260cafb13422bf6147c73b4a718998 /src/flash/nand.h | |
parent | 4189fdad28c283602b80ff7bc5a43bd5963019e7 (diff) |
Add Flash/NAND bank command argument helpers.
This eliminates redundant code for parsing and retreiving the bank
specified from a script command argument. This patch was written to
replace existing functionality; however, the parsing logic can be
updated later to allow flash commands to accept bank names as well as
their numbers.
Diffstat (limited to 'src/flash/nand.h')
-rw-r--r-- | src/flash/nand.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flash/nand.h b/src/flash/nand.h index b73e3304..d8674943 100644 --- a/src/flash/nand.h +++ b/src/flash/nand.h @@ -217,6 +217,11 @@ extern int nand_calculate_ecc_kw(struct nand_device_s *device, const uint8_t *da extern int nand_register_commands(struct command_context_s *cmd_ctx); extern int nand_init(struct command_context_s *cmd_ctx); +/// helper for parsing a nand device command argument string +int nand_command_get_device_by_num(struct command_context_s *cmd_ctx, + char *str, nand_device_t **device); + + #define ERROR_NAND_DEVICE_INVALID (-1100) #define ERROR_NAND_OPERATION_FAILED (-1101) #define ERROR_NAND_OPERATION_TIMEOUT (-1102) |