aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_imx.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2009-10-01 18:44:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-01 19:11:17 -0400
commitd1c627b59c8e69d40b94a4ff28a582a84c6a95a3 (patch)
tree33af5b1de0fba893b174feafe63216e565e6a5e1 /drivers/spi/spi_imx.c
parent4388eb11351660c7688a4756aa6da99bfb4bc129 (diff)
spi-imx: initialize complete config struct
Otherwise the config function uses random data from the stack. This didn't stick out because config is called once more in the chipselect function with correct parameters. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Sascha Hauer <s.hauer@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>
Diffstat (limited to 'drivers/spi/spi_imx.c')
-rw-r--r--drivers/spi/spi_imx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index b6a8149220fb..2fec1170b6c0 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -442,6 +442,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
442 config.bpw = t ? t->bits_per_word : spi->bits_per_word; 442 config.bpw = t ? t->bits_per_word : spi->bits_per_word;
443 config.speed_hz = t ? t->speed_hz : spi->max_speed_hz; 443 config.speed_hz = t ? t->speed_hz : spi->max_speed_hz;
444 config.mode = spi->mode; 444 config.mode = spi->mode;
445 config.cs = spi_imx->chipselect[spi->chip_select];
445 446
446 if (!config.speed_hz) 447 if (!config.speed_hz)
447 config.speed_hz = spi->max_speed_hz; 448 config.speed_hz = spi->max_speed_hz;