summaryrefslogtreecommitdiffstats
path: root/bitbang_spi.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2017-04-22 00:09:42 +0200
committerNico Huber <nico.h@gmx.de>2019-06-23 13:06:51 +0000
commitcb44eb7dad17522f47792dca4fc499310ff7d6f3 (patch)
tree026822102436ac0dcda8d8d007f16757ad73488b /bitbang_spi.c
parent712ba3a0659a70c2e93a55d9e194b2fae6db28d1 (diff)
downloadflashrom-cb44eb7dad17522f47792dca4fc499310ff7d6f3.tar.gz
flashrom-cb44eb7dad17522f47792dca4fc499310ff7d6f3.tar.bz2
flashrom-cb44eb7dad17522f47792dca4fc499310ff7d6f3.zip
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 <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33638 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'bitbang_spi.c')
-rw-r--r--bitbang_spi.c8
1 files changed, 2 insertions, 6 deletions
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)) {