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/memory_bus.c b/memory_bus.c
index fafe385..edc48e6 100644
--- a/memory_bus.c
+++ b/memory_bus.c
@@ -61,7 +61,7 @@
return addr;
}
-int prepare_memory_access(struct flashctx *flash, enum preparation_steps prep)
+int prepare_memory_access(struct flashctx *flash)
{
const struct par_master *const par = flash->mst.par;
@@ -80,11 +80,11 @@
return 0;
}
-int prepare_memory_register_access(struct flashctx *flash, enum preparation_steps prep)
+int prepare_memory_register_access(struct flashctx *flash)
{
const struct par_master *const par = flash->mst.par;
- if (prepare_memory_access(flash, prep))
+ if (prepare_memory_access(flash))
return 1;
/*