aboutsummaryrefslogtreecommitdiffstats
path: root/at45db.c
diff options
context:
space:
mode:
Diffstat (limited to 'at45db.c')
-rw-r--r--at45db.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/at45db.c b/at45db.c
index 53e15ec8..78773309 100644
--- a/at45db.c
+++ b/at45db.c
@@ -80,9 +80,10 @@ static unsigned int at45db_get_sector_count(struct flashctx *flash)
unsigned int i, j;
unsigned int cnt = 0;
for (i = 0; i < NUM_ERASEFUNCTIONS; i++) {
- if (flash->chip->block_erasers[i].block_erase == SPI_ERASE_AT45DB_SECTOR) {
+ const struct block_eraser *const eraser = &flash->chip->block_erasers[i];
+ if (eraser->block_erase == SPI_ERASE_AT45DB_SECTOR) {
for (j = 0; j < NUM_ERASEREGIONS; j++) {
- cnt += flash->chip->block_erasers[i].eraseblocks[j].count;
+ cnt += eraser->eraseblocks[j].count;
}
}
}