spi: Pass master instead of flash to .send_command

In the SPI-master API, `.send_command` should only forward commands to
the SPI bus. All details about the commands and the SPI slave should be
handled in the chip driver. Hence, replace the `flashctx` pointer with
one to the `spi_master` to enforce proper separation.

Change-Id: I50934a1294217794b7e23cc98ade7e4279c059a1
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/74897
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/pickit2_spi.c b/pickit2_spi.c
index 9a0691e..43126cc 100644
--- a/pickit2_spi.c
+++ b/pickit2_spi.c
@@ -198,11 +198,11 @@
 	return 0;
 }
 
-static int pickit2_spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt,
-				     const unsigned char *writearr, unsigned char *readarr)
+static int pickit2_spi_send_command(const struct spi_master *mst, unsigned int writecnt, unsigned int readcnt,
+				    const unsigned char *writearr, unsigned char *readarr)
 {
 	const unsigned int total_packetsize = writecnt + readcnt + 20;
-	struct pickit2_spi_data *pickit2_data = flash->mst.spi->data;
+	struct pickit2_spi_data *pickit2_data = mst->data;
 
 	/* Maximum number of bytes per transaction (including command overhead) is 64. Lets play it safe
 	 * and always assume the worst case scenario of 20 bytes command overhead.