flash: use correct device_id mask
[fw/openocd] / src / flash / nor / ecos.c
index f9c32854881cbbab78a628ba0ce01f574342f8e2..cae89358db529a6b7f363718c38e4e2bd83d6e89 100644 (file)
@@ -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;
                }
        }