diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2013-08-10 20:33:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-11 09:06:30 -0400 |
commit | b1a8e78d173081c303bea88e92a1e1423befca63 (patch) | |
tree | 6d4b0b1207a78c9525d18d56e7c80055f7dd738c /drivers/spi | |
parent | b998aca8ade221d592c8fc6b00687f2c4034d918 (diff) |
spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()
Not all fields of dma_slave_config struct are being initialized by
prepare_dma() function, leaving those which are not in undefined state,
which can confuse DMA drivers using them.
This patch adds call to memset() to zero the struct before initializing
a subset of its fields.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index c9d0b1273be9..d67384b3c318 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -392,6 +392,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, | |||
392 | struct scatterlist sg; | 392 | struct scatterlist sg; |
393 | struct dma_async_tx_descriptor *desc; | 393 | struct dma_async_tx_descriptor *desc; |
394 | 394 | ||
395 | memset(&config, 0, sizeof(config)); | ||
396 | |||
395 | if (dma->direction == DMA_DEV_TO_MEM) { | 397 | if (dma->direction == DMA_DEV_TO_MEM) { |
396 | sdd = container_of((void *)dma, | 398 | sdd = container_of((void *)dma, |
397 | struct s3c64xx_spi_driver_data, rx_dma); | 399 | struct s3c64xx_spi_driver_data, rx_dma); |