From 11e545f56091e4fa808bd57a215d6b8066b39295 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Fri, 23 Oct 2009 01:13:19 -0700 Subject: 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. --- src/flash/nand.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/flash/nand.h') 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) -- cgit v1.2.3