spi: Register spi_master state so spi_master_4ba() is valid

Due to a miss-match between dispatch mechanisms between forks
state wasn't getting registered for spi_master_4ba() to be
properly defined. This attempts to remedy the issue while not
introducing even more technical debt - i.e., half a step back
instead of two.

BUG=chromium:995439
TEST=none
BRANCH=none

Change-Id: Iec42cc1133fa65a17fecf03e2a9390e7c3419e69
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/1771375
Reviewed-by: Mathew King <mathewk@chromium.org>
diff --git a/spi.c b/spi.c
index 6d50754..04a1937 100644
--- a/spi.c
+++ b/spi.c
@@ -202,8 +202,16 @@
 	}
 }
 
-void register_spi_master(const struct spi_master *pgm)
+int register_spi_master(const struct spi_master *mst)
 {
-	spi_master = pgm;
+	struct registered_master rmst;
+
+	// TODO(quasisec): Kill off these global states.
+	spi_master = mst;
 	buses_supported |= BUS_SPI;
+
+	rmst.buses_supported = BUS_SPI;
+	rmst.spi = *mst;
+
+	return register_master(&rmst);
 }