Xilinx: SPI: Fix bits_per_word for transfers
[pandora-kernel.git] / drivers / spi / xilinx_spi.c
index 46b8c5c..5a143b9 100644 (file)
@@ -148,7 +148,8 @@ static int xilinx_spi_setup_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);