diff options
Diffstat (limited to 'bitbang_spi.c')
-rw-r--r-- | bitbang_spi.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/bitbang_spi.c b/bitbang_spi.c index 4b391641..2dad1499 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)) { |