opaque: Move probing into PREPARE_POST_PROBE hook
To get rid of the flash context in probing, we have to split the
detection of chip parameters out into a preparation step. Below
the opaque-master API, things could actually stay as they are,
we rename `.probe` to `.prepare` though for completeness.
Change-Id: Ic8418e6c5bdc49f5133cdb21efed0bf6dc2f820e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/449
diff --git a/include/programmer.h b/include/programmer.h
index 589765b..7da687d 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -431,7 +431,7 @@
int max_data_read;
int max_data_write;
/* Specific functions for this master */
- int (*probe) (struct flashctx *flash);
+ int (*prepare) (struct flashctx *flash);
int (*read) (struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int (*write) (struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*erase) (struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen);