diff options
Diffstat (limited to 'src/flash/cfi.c')
-rw-r--r-- | src/flash/cfi.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 66a1c656..82120d8d 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -1375,11 +1375,11 @@ int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, }
/* allocate working area */
- if (target_alloc_working_area(target, 24 * 4,
- &cfi_info->write_algorithm) != ERROR_OK)
+ retval=target_alloc_working_area(target, 24 * 4,
+ &cfi_info->write_algorithm);
+ if (retval != ERROR_OK)
{
- WARNING("no working area available, can't do block memory writes");
- return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+ return retval;
}
/* write algorithm code to working area */
@@ -1645,11 +1645,6 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) int i;
int retval;
- if (bank->target->state != TARGET_HALTED)
- {
- return ERROR_TARGET_NOT_HALTED;
- }
-
if (offset + count > bank->size)
return ERROR_FLASH_DST_OUT_OF_BANK;
|