* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
- * Copyright (C) 2007,2008 Øyvind Harboe *
+ * Copyright (C) 2007,2008 Øyvind Harboe *
* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2008 by Spencer Oliver *
* that matches @c DRIVERNAME.
*
* The flash subsystem calls some of the other drivers routines a using
- * corresponding static <code > flash_driver_ < i>callback</i > ()</code>
+ * corresponding static <code>flash_driver_<i>callback</i>()</code>
* routine in flash.c.
*/
typedef struct flash_driver_s
* @returns A flash_bank_t for flash bank @a num, or NULL
*/
extern flash_bank_t *get_flash_bank_by_num(int num);
+/**
+ * Retreives @a bank from a command argument, reporting errors parsing
+ * the bank identifier or retreiving the specified bank.
+ * @param cmd_ctx The command context for reporting errors.
+ * @param str The string containing the bank identifier.
+ * @param bank On output, contians a pointer to the bank or NULL.
+ * @returns ERROR_OK on success, or an error indicating the problem.
+ */
+int flash_command_get_bank_by_num(
+ struct command_context_s *cmd_ctx, char *str, flash_bank_t **bank);
/**
* Returns the flash bank like get_flash_bank_by_num(), without probing.
* @param num The flash bank number.