Introduce a priority for bus-probing functions

We want to stop probing once anything was detected by specific,
high-priority probing functions. This can benefit, for example,
the probing of non-flash chips on the SPI bus. So far we didn't
probe for these automatically, because the probing commands can
be misunderstood by SPI flashes.

We'll invoke the probing functions in order of their priority,
starting with priority `0'. Once any of them returns something
that doesn't look like continuous 0 or 1 bits,  we'll skip all
probing functions with less priority.

Change-Id: Ibde3c348a2fb84b71c325a6c2719e9f2c8b5e784
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/418
diff --git a/spi.c b/spi.c
index 8d07ed1..da66a68 100644
--- a/spi.c
+++ b/spi.c
@@ -163,13 +163,13 @@
 }
 
 static const struct bus_probe spi_probes[] = {
-       /* type		function		function argument */
-	{ ID_SPI_RDID,	probe_spi_rdid,		NULL },
-	{ ID_SPI_AT25F,	probe_spi_at25f,	NULL },
-	{ ID_SPI_REMS,	probe_spi_rems,		NULL },
-	{ ID_SPI_RES3,	probe_spi_res,		NULL },
-	{ ID_SPI_RES2,	probe_spi_res,		NULL },
-	{ ID_SPI_RES1,	probe_spi_res,		NULL },
+    /* prio. type		function		function argument */
+	{ 0, ID_SPI_RDID,	probe_spi_rdid,		NULL },
+	{ 0, ID_SPI_AT25F,	probe_spi_at25f,	NULL },
+	{ 0, ID_SPI_REMS,	probe_spi_rems,		NULL },
+	{ 0, ID_SPI_RES3,	probe_spi_res,		NULL },
+	{ 0, ID_SPI_RES2,	probe_spi_res,		NULL },
+	{ 0, ID_SPI_RES1,	probe_spi_res,		NULL },
 };
 
 static bool spi_probe_match(const struct flashchip *chip, const struct id_info_ext *found)