libflashprog: Introduce new probing API flashprog_flash_probe_chip()
This new probing API acts about the same as the old one, except that
it accepts a `struct flashprog_chip *` handle instead of a chip name.
Under the hood, however, it uses our new bus probing directly.
We introduce a new function, flashprog_flash_prepare_context(), that
creates a flash context from a probed chip, and the bus it was found
on. This will be the single place that creates flash contexts in the
future.
Change-Id: I1a344aedf573d92f8f297e6eed8daadb511ebc10
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/484
diff --git a/include/flash.h b/include/flash.h
index 3ad9d1f..31b4f0c 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -440,10 +440,10 @@
uintptr_t physical_registers;
chipaddr virtual_registers;
union {
- struct master_common *common;
- struct par_master *par;
- struct spi_master *spi;
- struct opaque_master *opaque;
+ const struct master_common *common;
+ const struct par_master *par;
+ const struct spi_master *spi;
+ const struct opaque_master *opaque;
} mst;
const struct flashprog_layout *layout;
struct flashprog_layout *default_layout;