From: John Linn Date: Mon, 14 Sep 2009 08:17:05 +0000 (+0000) Subject: Xilinx: SPI: Fix bits_per_word for transfers X-Git-Tag: v2.6.33-rc1~9^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a8d3b777dd71813b87c66c0eb161cc87f042126;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Grant Likely --- diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 46b8c5c..5a143b9 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, { 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);