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/linux_mtd.c b/linux_mtd.c
index 3725920..d4c0600 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -173,7 +173,7 @@
return 0;
}
-static int linux_mtd_probe(struct flashctx *flash)
+static int linux_mtd_prepare(struct flashctx *flash)
{
struct linux_mtd_data *data = flash->mst.opaque->data;
@@ -307,7 +307,7 @@
/* max_data_{read,write} don't have any effect for this programmer */
.max_data_read = MAX_DATA_UNSPECIFIED,
.max_data_write = MAX_DATA_UNSPECIFIED,
- .probe = linux_mtd_probe,
+ .prepare = linux_mtd_prepare,
.read = linux_mtd_read,
.write = linux_mtd_write,
.erase = linux_mtd_erase,