probing: Pass full struct flashchip into probes
In case we want to probe for a particular chip, we can filter the
actual probing sequences by its properties.
We'll use `struct flashchip` internally and `struct flashprog_chip`
will be used only close to the libflashprog API. This way, we can
separate the two later again if necessary.
Change-Id: Id8b13d28fcaefee62746c9391fe86b4b3b09a428
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/441
diff --git a/include/chipdrivers/probing.h b/include/chipdrivers/probing.h
index 18eb347..9d00970 100644
--- a/include/chipdrivers/probing.h
+++ b/include/chipdrivers/probing.h
@@ -69,20 +69,20 @@
struct id_info_ext info;
};
-struct flashprog_chip;
struct master_common;
+struct flashchip;
struct bus_probe {
unsigned int priority;
enum id_type type;
- struct found_id *(*run)(const struct bus_probe *, const struct master_common *);
+ struct found_id *(*run)(const struct bus_probe *, const struct master_common *, const struct flashchip *);
void *arg;
};
struct bus_probing {
unsigned int probe_count;
const struct bus_probe *probes;
- bool (*match)(const struct flashprog_chip *, const struct id_info_ext *);
+ bool (*match)(const struct flashchip *, const struct id_info_ext *);
};
struct flashprog_flashctx;