linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()
@ 2013-08-11  0:33 Tomasz Figa
  2013-08-11  0:33 ` [PATCH 2/3] spi: s3c64xx: Do not request CS GPIO on subsequent calls to .setup() Tomasz Figa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tomasz Figa @ 2013-08-11  0:33 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 drivers/spi/spi-s3c64xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 62f32c4..1be162c 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -389,6 +389,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
 	struct scatterlist sg;
 	struct dma_async_tx_descriptor *desc;
 
+	memset(&config, 0, sizeof(config));
+
 	if (dma->direction == DMA_DEV_TO_MEM) {
 		sdd = container_of((void *)dma,
 			struct s3c64xx_spi_driver_data, rx_dma);
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-11 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-11  0:33 [PATCH 1/3] spi: s3c64xx: Zero dma_slave_config struct in prepare_dma() Tomasz Figa
2013-08-11  0:33 ` [PATCH 2/3] spi: s3c64xx: Do not request CS GPIO on subsequent calls to .setup() Tomasz Figa
2013-08-11  0:33 ` [PATCH 3/3] spi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfers Tomasz Figa
2013-08-11 13:07 ` [PATCH 1/3] spi: s3c64xx: Zero dma_slave_config struct in prepare_dma() Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).