Changed length parameter in SPI methods to be a byte length, rather than

a word length.
This commit is contained in:
Michael Brown
2006-12-04 16:09:59 +00:00
parent 931f94dca3
commit dc06c895fc
5 changed files with 15 additions and 21 deletions

View File

@@ -139,13 +139,12 @@ static void spi_bit_transfer ( struct spi_bit_basher *spibit,
* @v address Address to read/write (<0 for no address)
* @v data_out TX data buffer (or NULL)
* @v data_in RX data buffer (or NULL)
* @v len Length of transfer (in @b words)
* @v len Length of transfer
* @ret rc Return status code
*/
static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
unsigned int command, int address,
const void *data_out, void *data_in,
unsigned int len ) {
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;
@@ -167,8 +166,7 @@ static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
}
/* Transmit/receive data */
spi_bit_transfer ( spibit, data_out, data_in,
( len * devtype->word_len ) );
spi_bit_transfer ( spibit, data_out, data_in, ( len * 8 ) );
/* Deassert chip select on specified slave */
spi_bit_set_slave_select ( spibit, device->slave, DESELECT_SLAVE );