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 --- lspcon_i2c_spi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lspcon_i2c_spi.c') diff --git a/lspcon_i2c_spi.c b/lspcon_i2c_spi.c index b590f1db9..e9ff2ddc7 100644 --- a/lspcon_i2c_spi.c +++ b/lspcon_i2c_spi.c @@ -410,16 +410,6 @@ static int lspcon_i2c_spi_write_aai(struct flashctx *flash, const uint8_t *buf, return SPI_GENERIC_ERROR; } -static const struct spi_master spi_master_i2c_lspcon = { - .max_data_read = 16, - .max_data_write = 12, - .command = lspcon_i2c_spi_send_command, - .multicommand = default_spi_send_multicommand, - .read = lspcon_i2c_spi_read, - .write_256 = lspcon_i2c_spi_write_256, - .write_aai = lspcon_i2c_spi_write_aai, -}; - static int lspcon_i2c_spi_shutdown(void *data) { int ret = 0; @@ -436,6 +426,16 @@ static int lspcon_i2c_spi_shutdown(void *data) return ret; } +static const struct spi_master spi_master_i2c_lspcon = { + .max_data_read = 16, + .max_data_write = 12, + .command = lspcon_i2c_spi_send_command, + .multicommand = default_spi_send_multicommand, + .read = lspcon_i2c_spi_read, + .write_256 = lspcon_i2c_spi_write_256, + .write_aai = lspcon_i2c_spi_write_aai, +}; + static int lspcon_i2c_spi_init(void) { int fd = i2c_open_from_programmer_params(REGISTER_ADDRESS, 0); -- cgit v1.2.3