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/cli_config.c b/cli_config.c
index 5275fe2..83d86d3 100644
--- a/cli_config.c
+++ b/cli_config.c
@@ -37,7 +37,7 @@
{
switch (setting) {
case QUAD_ENABLE:
- return &flash->chip->reg_bits.qe;
+ return &flash->chip.reg_bits.qe;
default:
return NULL;
}
@@ -245,7 +245,7 @@
goto shutdown_ret;
}
- if (flash->chip->bustype != BUS_SPI || flash->chip->spi_cmd_set != SPI25) {
+ if (flash->chip.bustype != BUS_SPI || flash->chip.spi_cmd_set != SPI25) {
fprintf(stderr, "Only SPI25 flash chips are supported.\n");
goto shutdown_ret;
}