From 90739d147f1d9b90789873fdbe74da6c616cad6b Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Tue, 11 May 2021 17:53:34 +0200 Subject: programmer: Make use of new register_spi_master() API Pass pointers to dynamically allocated data to register_spi_master(). This way we can avoid some mutable globals. Change-Id: Id7821f1db3284b7b5b3d0abfd878b979c53870a1 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/flashrom/+/54067 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- it87spi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'it87spi.c') diff --git a/it87spi.c b/it87spi.c index 0760ac864..92c95fa40 100644 --- a/it87spi.c +++ b/it87spi.c @@ -290,7 +290,7 @@ static int it8716f_spi_chip_write_256(struct flashctx *flash, const uint8_t *buf return 0; } -static struct spi_master spi_master_it87xx = { +static const struct spi_master spi_master_it87xx = { .max_data_read = 3, .max_data_write = MAX_DATA_UNSPECIFIED, .command = it8716f_spi_send_command, @@ -419,14 +419,13 @@ static uint16_t it87spi_probe(uint16_t port) data->flashport = flashport; data->fast_spi = 1; - spi_master_it87xx.data = data; register_shutdown(it8716f_shutdown, data); if (internal_buses_supported & BUS_SPI) msg_pdbg("Overriding chipset SPI with IT87 SPI.\n"); /* FIXME: Add the SPI bus or replace the other buses with it? */ - register_spi_master(&spi_master_it87xx, NULL); + register_spi_master(&spi_master_it87xx, data); return 0; } -- cgit v1.2.3