Messages in this thread Patch in this message | | | Date | Thu, 13 Aug 2009 11:06:05 +0100 | From | Ben Dooks <> | Subject | [patch 3/7] spi_s3c24xx; Fix transfer setup code |
| |
Since the changes to the bitbang driver, there is the possibility we will be called with either the speed_hz or bpw values zero. We take these to mean that the default values (8 bits per word, or maximum bus speed).
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
---
Index: b/drivers/spi/spi_s3c24xx.c =================================================================== --- a/drivers/spi/spi_s3c24xx.c 2009-07-27 18:55:16.000000000 +0100 +++ b/drivers/spi/spi_s3c24xx.c 2009-07-27 18:56:08.000000000 +0100 @@ -116,6 +116,12 @@ static int s3c24xx_spi_setupxfer(struct bpw = t ? t->bits_per_word : spi->bits_per_word; hz = t ? t->speed_hz : spi->max_speed_hz; + if (!bpw) + bpw = 8; + + if (!hz) + hz = spi->max_speed_hz; + if (bpw != 8) { dev_err(&spi->dev, "invalid bits-per-word (%d)\n", bpw); return -EINVAL; --
| |