Commit 1a8d3b77 authored by John Linn's avatar John Linn Committed by Grant Likely

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: default avatarJohn Linn <john.linn@xilinx.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent f856cf01
...@@ -148,7 +148,8 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, ...@@ -148,7 +148,8 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi,
{ {
u8 bits_per_word; u8 bits_per_word;
bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; bits_per_word = (t && t->bits_per_word)
? t->bits_per_word : spi->bits_per_word;
if (bits_per_word != 8) { if (bits_per_word != 8) {
dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
__func__, bits_per_word); __func__, bits_per_word);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment