diff options
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 |
commit | 4532dc78314a543f205e15d37d1bc7fa03df7595 (patch) | |
tree | 5178378ba58ccaf136feb236faac45767fb194c1 /src/flash/nor/core.h | |
parent | 0538081246fafbfb74d554bb1b758412534aa254 (diff) | |
download | riscv-openocd-4532dc78314a543f205e15d37d1bc7fa03df7595.zip riscv-openocd-4532dc78314a543f205e15d37d1bc7fa03df7595.tar.gz riscv-openocd-4532dc78314a543f205e15d37d1bc7fa03df7595.tar.bz2 |
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.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h index 17f1c53..ff14df0 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 |