From 0a7f036610673f6664c9d1492912abfdfbdf9f20 Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Tue, 6 Jul 2021 16:03:11 +1000 Subject: spi_master: Move shutdown function above spi_master struct This patch prepares spi masters to use new API which allows to register shutdown function in spi_master struct. See also later patch in this chain, where spi masters are converted to new API. BUG=b:185191942 TEST=builds and ninja test Comparing flashrom binary before and after the patch, make clean && make CONFIG_EVERYTHING=yes VERSION=none binary is the same Change-Id: I50716686552b4ddcc6089d5afadb19ef59d9f9b4 Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/56101 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Nico Huber --- jlink_spi.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'jlink_spi.c') diff --git a/jlink_spi.c b/jlink_spi.c index 8b8533ca..daa8eb67 100644 --- a/jlink_spi.c +++ b/jlink_spi.c @@ -155,19 +155,6 @@ static int jlink_spi_send_command(const struct flashctx *flash, unsigned int wri return 0; } -static const struct spi_master spi_master_jlink_spi = { - /* Maximum data read size in one go (excluding opcode+address). */ - .max_data_read = JTAG_MAX_TRANSFER_SIZE - 5, - /* Maximum data write size in one go (excluding opcode+address). */ - .max_data_write = JTAG_MAX_TRANSFER_SIZE - 5, - .command = jlink_spi_send_command, - .multicommand = default_spi_send_multicommand, - .read = default_spi_read, - .write_256 = default_spi_write_256, - .write_aai = default_spi_write_aai, - .features = SPI_MASTER_4BA, -}; - static int jlink_spi_shutdown(void *data) { struct jlink_spi_data *jlink_data = data; @@ -181,6 +168,19 @@ static int jlink_spi_shutdown(void *data) return 0; } +static const struct spi_master spi_master_jlink_spi = { + /* Maximum data read size in one go (excluding opcode+address). */ + .max_data_read = JTAG_MAX_TRANSFER_SIZE - 5, + /* Maximum data write size in one go (excluding opcode+address). */ + .max_data_write = JTAG_MAX_TRANSFER_SIZE - 5, + .command = jlink_spi_send_command, + .multicommand = default_spi_send_multicommand, + .read = default_spi_read, + .write_256 = default_spi_write_256, + .write_aai = default_spi_write_aai, + .features = SPI_MASTER_4BA, +}; + static int jlink_spi_init(void) { char *arg; -- cgit v1.2.1