diff options
author | Michael Brown | 2006-12-04 19:23:06 +0100 |
---|---|---|
committer | Michael Brown | 2006-12-04 19:23:06 +0100 |
commit | 946967f09ce0ab9ab438a0647d393601dd0fca23 (patch) | |
tree | 0e133cb2d481d3e683ecc5be7dcfa0610eaf2f79 /src/drivers/bitbash | |
parent | Changed length parameter in SPI methods to be a byte length, rather than (diff) | |
download | ipxe-946967f09ce0ab9ab438a0647d393601dd0fca23.tar.gz ipxe-946967f09ce0ab9ab438a0647d393601dd0fca23.tar.xz ipxe-946967f09ce0ab9ab438a0647d393601dd0fca23.zip |
Abstracted out part of the concept of an SPI device to a generalised NVS
device.
Separated the mechanisms of non-volatile storage access and non-volatile
stored options.
Diffstat (limited to 'src/drivers/bitbash')
-rw-r--r-- | src/drivers/bitbash/spi_bit.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/drivers/bitbash/spi_bit.c b/src/drivers/bitbash/spi_bit.c index ef1d8ff7..8b89f01d 100644 --- a/src/drivers/bitbash/spi_bit.c +++ b/src/drivers/bitbash/spi_bit.c @@ -147,22 +147,21 @@ static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device, const void *data_out, void *data_in, size_t len ) { struct spi_bit_basher *spibit = container_of ( bus, struct spi_bit_basher, bus ); - struct spi_device_type *devtype = device->type; uint32_t tmp; /* Assert chip select on specified slave */ spi_bit_set_slave_select ( spibit, device->slave, SELECT_SLAVE ); /* Transmit command */ - assert ( devtype->command_len <= ( 8 * sizeof ( tmp ) ) ); + assert ( device->command_len <= ( 8 * sizeof ( tmp ) ) ); tmp = cpu_to_le32 ( command ); - spi_bit_transfer ( spibit, &tmp, NULL, devtype->command_len ); + spi_bit_transfer ( spibit, &tmp, NULL, device->command_len ); /* Transmit address, if present */ if ( address >= 0 ) { - assert ( devtype->address_len <= ( 8 * sizeof ( tmp ) ) ); + assert ( device->address_len <= ( 8 * sizeof ( tmp ) ) ); tmp = cpu_to_le32 ( address ); - spi_bit_transfer ( spibit, &tmp, NULL, devtype->address_len ); + spi_bit_transfer ( spibit, &tmp, NULL, device->address_len ); } /* Transmit/receive data */ |