flash/nor: Do not update 'is_erased'
[fw/openocd] / src / flash / nor / stellaris.c
index 569c09b46915026c6112e2068d0a2b6c70ab1c2d..d2638c152dd9e5672314d7c7c24e8cf7d65b0f3e 100644 (file)
@@ -886,8 +886,6 @@ static int stellaris_erase(struct flash_bank *bank, unsigned int first,
                        target_write_u32(target, FLASH_CRIS, 0);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
-
-               bank->sectors[banknr].is_erased = 1;
        }
 
        return ERROR_OK;
@@ -1318,13 +1316,9 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
        if (retval != ERROR_OK)
                return retval;
 
-       if (stellaris_mass_erase(bank) == ERROR_OK) {
-               /* set all sectors as erased */
-               for (unsigned int i = 0; i < bank->num_sectors; i++)
-                       bank->sectors[i].is_erased = 1;
-
+       if (stellaris_mass_erase(bank) == ERROR_OK)
                command_print(CMD, "stellaris mass erase complete");
-       else
+       else
                command_print(CMD, "stellaris mass erase failed");
 
        return ERROR_OK;