Draw struct flashchip into struct flashprog_flashctx
We used to have a reference to a dynamically allocated struct flashchip
inside the flash context. But now that we only ever allocate both in one
go, we can let go of the reference and make it a single structure.
Change-Id: I857acb1def6d133a5cbc28fc7a99b7b1a22b55e0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/494
diff --git a/amd_rom3read.c b/amd_rom3read.c
index 98ba5d2..2d93128 100644
--- a/amd_rom3read.c
+++ b/amd_rom3read.c
@@ -69,12 +69,12 @@
flash_size = estimate_addressable_size(rom3, 64*MiB);
}
- flash->chip->total_size = flash_size / KiB;
- flash->chip->feature_bits |= FEATURE_NO_ERASE;
- flash->chip->tested = (struct flashprog_test_status)
+ flash->chip.total_size = flash_size / KiB;
+ flash->chip.feature_bits |= FEATURE_NO_ERASE;
+ flash->chip.tested = (struct flashprog_test_status)
{ .probe = OK, .read = OK, .erase = NA, .write = NA, .block_protection = NA };
- return !!flash->chip->total_size;
+ return !!flash->chip.total_size;
}
static int rom3read_read(struct flashctx *const flash, uint8_t *buf, unsigned int start, unsigned int len)