diff options
author | John Linn <john.linn@xilinx.com> | 2009-09-14 04:17:05 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-11-04 18:42:47 -0500 |
commit | 1a8d3b777dd71813b87c66c0eb161cc87f042126 (patch) | |
tree | c29b546b014acb28e5d6a424a5abeed75c8279eb /drivers/spi/xilinx_spi.c | |
parent | f856cf01787354fb3c8cde0a80de606f368b21ed (diff) |
Xilinx: SPI: Fix bits_per_word for transfers
The bits_per_word value can be set for each transfer, or can
be set to zero in each transfer in which case it should default
to the value in the driver.
The driver was fixed to properly check the bits_per_word in
the transfer that is passed in.
Signed-off-by: John Linn <john.linn@xilinx.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/xilinx_spi.c')
-rw-r--r-- | drivers/spi/xilinx_spi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 46b8c5c2f45e..5a143b9f6361 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c | |||
@@ -148,7 +148,8 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, | |||
148 | { | 148 | { |
149 | u8 bits_per_word; | 149 | u8 bits_per_word; |
150 | 150 | ||
151 | bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; | 151 | bits_per_word = (t && t->bits_per_word) |
152 | ? t->bits_per_word : spi->bits_per_word; | ||
152 | if (bits_per_word != 8) { | 153 | if (bits_per_word != 8) { |
153 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", | 154 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", |
154 | __func__, bits_per_word); | 155 | __func__, bits_per_word); |