]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
spi-imx: update state correctly
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 1 Oct 2009 22:44:29 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Oct 2009 23:11:16 +0000 (16:11 -0700)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-K├Ânig <u.kleine-koenig@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/spi_imx.c

index b1f530fd6bdc48368a73940d8f04af33bb249725..a8f9bff529e5a4c4f7c4750284a1a4fe1ec45551 100644 (file)
@@ -443,6 +443,13 @@ static int spi_imx_setupxfer(struct spi_device *spi,
        config.speed_hz  = t ? t->speed_hz : spi->max_speed_hz;
        config.mode = spi->mode;
 
+       if (!config.speed_hz)
+               config.speed_hz = spi->max_speed_hz;
+       if (!config.bpw)
+               config.bpw = spi->bits_per_word;
+       if (!config.speed_hz)
+               config.speed_hz = spi->max_speed_hz;
+
        spi_imx->config(spi_imx, &config);
 
        return 0;