summaryrefslogtreecommitdiff
path: root/src/flash/nor/core.h
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-06-11 08:10:39 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-06-11 15:53:23 +0200
commit4532dc78314a543f205e15d37d1bc7fa03df7595 (patch)
tree5178378ba58ccaf136feb236faac45767fb194c1 /src/flash/nor/core.h
parent0538081246fafbfb74d554bb1b758412534aa254 (diff)
downloadopenocd+libswd-4532dc78314a543f205e15d37d1bc7fa03df7595.tar.gz
openocd+libswd-4532dc78314a543f205e15d37d1bc7fa03df7595.tar.bz2
openocd+libswd-4532dc78314a543f205e15d37d1bc7fa03df7595.tar.xz
openocd+libswd-4532dc78314a543f205e15d37d1bc7fa03df7595.zip
flash: add error handling to get_flash_by_addr/name
autoprobing can fail and this error has to be reported up the call stack. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/flash/nor/core.h')
-rw-r--r--src/flash/nor/core.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h
index 17f1c53f..ff14df0a 100644
--- a/src/flash/nor/core.h
+++ b/src/flash/nor/core.h
@@ -168,7 +168,7 @@ int default_flash_mem_blank_check(struct flash_bank *bank);
* 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);
+int get_flash_bank_by_name(const char *name, struct flash_bank **bank_result);
/**
* Returns the flash bank specified by @a name, which matches the
* driver name and a suffix (option) specify the driver-specific
@@ -206,8 +206,9 @@ struct flash_bank *get_flash_bank_by_num_noprobe(int num);
* Returns the flash bank located at a specified address.
* @param target The target, presumed to contain one or more banks.
* @param addr An address that is within the range of the bank.
+ * @param check return ERROR_OK and result_bank NULL if the bank does not exist
* @returns The struct flash_bank located at @a addr, or NULL.
*/
-struct flash_bank *get_flash_bank_by_addr(struct target *target, uint32_t addr);
+int get_flash_bank_by_addr(struct target *target, uint32_t addr, bool check, struct flash_bank **result_bank);
#endif // FLASH_NOR_CORE_H