*/
struct flash_bank
{
+ char *name;
+
struct target *target; /**< Target to which this bank belongs. */
struct flash_driver *driver; /**< Driver for this bank. */
*/
int default_flash_mem_blank_check(struct flash_bank *bank);
+/**
+ * Returns the flash bank specified by @a name, which matches the
+ * driver name and a suffix (option) specify the driver-specific
+ * bank number. The suffix consists of the '.' and the driver-specific
+ * bank number: when two str9x banks are defined, then 'str9x.1' refers
+ * to the second.
+ */
+struct flash_bank *get_flash_bank_by_name(const char *name);
/**
* Returns a flash bank by the specified flash_bank_s bank_number, @a num.
* @param num The flash bank number.
struct flash_bank *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.
+ * the bank identifier or retreiving the specified bank. The bank
+ * may be identified by its bank number or by @c name.instance, where
+ * @a instance is driver-specific.
* @param name_index The index to the string in args 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.
*/
-COMMAND_HELPER(flash_command_get_bank_by_num, unsigned name_index,
+COMMAND_HELPER(flash_command_get_bank, unsigned name_index,
struct flash_bank **bank);
/**
* Returns the flash bank like get_flash_bank_by_num(), without probing.