X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fecos.c;h=c850f4f9c26d484c46bb1813af099d5d8644432f;hp=b51e0a0338c3ff28132cfb35fc13abe9e2846dc8;hb=a17907d1067be45bd2aa4cc9bd108eccaf2e4df2;hpb=c2cc677056f8b383ff8f88ed8a16f1aa4b530ae2 diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index b51e0a0338..c850f4f9c2 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -173,7 +173,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 +264,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 +304,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 +322,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; } } @@ -431,14 +429,15 @@ static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char #endif struct flash_driver ecosflash_flash = { - .name = "ecosflash", - .flash_bank_command = &ecosflash_flash_bank_command, - .erase = &ecosflash_erase, - .protect = &ecosflash_protect, - .write = &ecosflash_write, - .probe = &ecosflash_probe, - .auto_probe = &ecosflash_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &ecosflash_protect_check, - .info = &ecosflash_info - }; + .name = "ecosflash", + .flash_bank_command = ecosflash_flash_bank_command, + .erase = ecosflash_erase, + .protect = ecosflash_protect, + .write = ecosflash_write, + .read = default_flash_read, + .probe = ecosflash_probe, + .auto_probe = ecosflash_probe, + .erase_check = default_flash_blank_check, + .protect_check = ecosflash_protect_check, + .info = ecosflash_info +};