1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 06:23:18 +02:00

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>
This commit is contained in:
Nico Huber
2017-04-22 00:09:42 +02:00
parent 712ba3a065
commit cb44eb7dad
8 changed files with 2 additions and 38 deletions

View File

@ -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)) {