X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fecos.c;h=cae89358db529a6b7f363718c38e4e2bd83d6e89;hb=ad0847ca38e4c9d7ea0051ac7718afd3aa61868e;hp=f9c32854881cbbab78a628ba0ce01f574342f8e2;hpb=bc8be110ff314cab0e09792a05b6871672c18302;p=fw%2Fopenocd diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index f9c328548..cae89358d 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -111,8 +111,7 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command) if (CMD_ARGC < 7) { - LOG_WARNING("incomplete flash_bank ecosflash configuration"); - return ERROR_FLASH_BANK_INVALID; + return ERROR_COMMAND_SYNTAX_ERROR; } info = malloc(sizeof(struct ecosflash_flash_bank)); @@ -173,7 +172,6 @@ static int loadDriver(struct ecosflash_flash_bank *info) for (i = 0; i < image.num_sections; i++) { void *buffer = malloc(image.sections[i].size); - int retval; if ((retval = image_read_section(&image, i, 0x0, image.sections[i].size, buffer, &buf_cnt)) != ERROR_OK) { free(buffer); @@ -265,7 +263,7 @@ static int eCosBoard_erase(struct ecosflash_flash_bank *info, uint32_t address, if (flashErr != 0x0) { - LOG_ERROR("Flash erase failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr)); + LOG_ERROR("Flash erase failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr)); return ERROR_FAIL; } @@ -305,7 +303,6 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32 t = chunk; } - int retval; retval = target_write_buffer(target, buffer, t, ((uint8_t *)data) + i); if (retval != ERROR_OK) return retval; @@ -324,7 +321,7 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32 if (flashErr != 0x0) { - LOG_ERROR("Flash prog failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr)); + LOG_ERROR("Flash prog failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr)); return ERROR_FAIL; } }