Run .prepare_access only once per flash context
There's only a single path now to create a flash context, after
probing, and only when we want to access the flash chip next. So
there's no need to defer this preparation step anymore.
All preparation will be done in a single step. Hence we drop the
PREPARE_POST_PROBE and PREPARE_FULL steps and the enum.
Change-Id: I7cd4058dd0b52ad0e4be45e494c4533f689893d9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/492
diff --git a/at45db.c b/at45db.c
index f84f3f4..2768ace 100644
--- a/at45db.c
+++ b/at45db.c
@@ -172,14 +172,11 @@
}
/* Adapt chip entry for AT45DB* chips that support multiple page sizes. */
-int spi_prepare_at45db(struct flashctx *const flash, const enum preparation_steps prep)
+int spi_prepare_at45db(struct flashctx *const flash)
{
struct flashchip *const chip = flash->chip;
uint8_t status;
- if (prep != PREPARE_POST_PROBE)
- return 0;
-
/* Power-of-2 check */
if (chip->page_size & (chip->page_size - 1))
return 0;