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/ft2232_spi.c b/ft2232_spi.c
index a82153d..6c6d49b 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -214,9 +214,9 @@
}
/* Returns 0 upon success, a negative number upon errors. */
-static int ft2232_spi_send_multicommand(const struct flashctx *flash, struct spi_command *cmds)
+static int ft2232_spi_send_multicommand(const struct spi_master *mst, struct spi_command *cmds)
{
- struct ft2232_data *spi_data = flash->mst.spi->data;
+ struct ft2232_data *spi_data = mst->data;
struct ftdi_context *ftdic = &spi_data->ftdi_context;
static unsigned char buf[FTDI_HW_BUFFER_SIZE];
size_t i = 0;