Le 24/11/2012 14:44, Jonas Gorski a écrit :
Transfers often do not have bits_per_words set, so use the spi device's
bits_per_words in this case.

This fixes the driver rejecting valid transfers e.g. generated by
spi_write() or spi_read().

Cc: [email protected]
Signed-off-by: Jonas Gorski <[email protected]>

Acked-by: Florian Fainelli <[email protected]>

---
  drivers/spi/spi-bcm63xx.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index a9f4049..d7c2916 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -103,7 +103,8 @@ static int bcm63xx_spi_check_transfer(struct spi_device 
*spi,
  {
        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) {
                dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
                        __func__, bits_per_word);


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to