From cb44eb7dad17522f47792dca4fc499310ff7d6f3 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 22 Apr 2017 00:09:42 +0200 Subject: bitbang_spi: Drop bitbang_spi_master_type It only existed to make maintenance harder and waste our time. Change-Id: I7a3b5d9ff1e99d2d4f873c6f19fb318f93762037 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/flashrom/+/33638 Tested-by: build bot (Jenkins) Reviewed-by: HAOUAS Elyes Reviewed-by: Angel Pons --- bitbang_spi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'bitbang_spi.c') diff --git a/bitbang_spi.c b/bitbang_spi.c index 4b3916411..2dad1499c 100644 --- a/bitbang_spi.c +++ b/bitbang_spi.c @@ -70,7 +70,6 @@ static int bitbang_spi_send_command(struct flashctx *flash, unsigned char *readarr); static const struct spi_master spi_master_bitbang = { - .type = SPI_CONTROLLER_BITBANG, .features = SPI_MASTER_4BA, .max_data_read = MAX_DATA_READ_UNLIMITED, .max_data_write = MAX_DATA_WRITE_UNLIMITED, @@ -92,11 +91,8 @@ static int bitbang_spi_shutdown(const struct bitbang_spi_master *master) int register_spi_bitbang_master(const struct bitbang_spi_master *master) { struct spi_master mst = spi_master_bitbang; - /* BITBANG_SPI_INVALID is 0, so if someone forgot to initialize ->type, - * we catch it here. Same goes for missing initialization of bitbanging - * functions. - */ - if (!master || master->type == BITBANG_SPI_INVALID || !master->set_cs || + /* If someone forgot to initialize a bitbang function, we catch it here. */ + if (!master || !master->set_cs || !master->set_sck || !master->set_mosi || !master->get_miso || (master->request_bus && !master->release_bus) || (!master->request_bus && master->release_bus)) { -- cgit v1.2.3