From a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Sat, 19 Jul 2014 22:03:29 +0000 Subject: Rename programmer registration functions Register_programmer suggests that we register a programmer. However, that function registers a master for a given bus type, and a programmer may support multiple masters (e.g. SPI, FWH). Rename a few other functions to be more consistent. Corresponding to flashrom svn r1831. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Tauner --- sb600spi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sb600spi.c') diff --git a/sb600spi.c b/sb600spi.c index b7f87caf..5710fb27 100644 --- a/sb600spi.c +++ b/sb600spi.c @@ -64,7 +64,7 @@ static int sb600_spi_send_command(struct flashctx *flash, unsigned int writecnt, static int spi100_spi_send_command(struct flashctx *flash, unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); -static struct spi_programmer spi_programmer_sb600 = { +static struct spi_master spi_master_sb600 = { .type = SPI_CONTROLLER_SB600, .max_data_read = FIFO_SIZE_OLD, .max_data_write = FIFO_SIZE_OLD - 3, @@ -75,7 +75,7 @@ static struct spi_programmer spi_programmer_sb600 = { .write_aai = default_spi_write_aai, }; -static struct spi_programmer spi_programmer_yangtze = { +static struct spi_master spi_master_yangtze = { .type = SPI_CONTROLLER_YANGTZE, .max_data_read = FIFO_SIZE_YANGTZE - 3, /* Apparently the big SPI 100 buffer is not a ring buffer. */ .max_data_write = FIFO_SIZE_YANGTZE - 3, @@ -184,14 +184,14 @@ static int compare_internal_fifo_pointer(uint8_t want) /* Check the number of bytes to be transmitted and extract opcode. */ static int check_readwritecnt(struct flashctx *flash, unsigned int writecnt, unsigned int readcnt) { - unsigned int maxwritecnt = flash->pgm->spi.max_data_write + 3; + unsigned int maxwritecnt = flash->mst->spi.max_data_write + 3; if (writecnt > maxwritecnt) { msg_pinfo("%s: SPI controller can not send %d bytes, it is limited to %d bytes\n", __func__, writecnt, maxwritecnt); return SPI_INVALID_LENGTH; } - unsigned int maxreadcnt = flash->pgm->spi.max_data_read + 3; + unsigned int maxreadcnt = flash->mst->spi.max_data_read + 3; if (readcnt > maxreadcnt) { msg_pinfo("%s: SPI controller can not receive %d bytes, it is limited to %d bytes\n", __func__, readcnt, maxreadcnt); @@ -690,9 +690,9 @@ int sb600_probe_spi(struct pci_dev *dev) /* Starting with Yangtze the SPI controller got a different interface with a much bigger buffer. */ if (amd_gen != CHIPSET_YANGTZE) - register_spi_programmer(&spi_programmer_sb600); + register_spi_master(&spi_master_sb600); else - register_spi_programmer(&spi_programmer_yangtze); + register_spi_master(&spi_master_yangtze); return 0; } -- cgit v1.2.3