aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-04-15 17:34:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-15 22:35:41 -0400
commit4bb5eba06b4bc57e30b0f6336c9907e85c395197 (patch)
treee471e6c09b5aa148eef724bc7ffd04ec5e59c04e /drivers/spi
parent335e92e8a515420bd47a6b0f01cb9a206c0ed6e4 (diff)
spi: spi_s3c24xx driver must init completion
The s3c24xx_spi_txrx() function should initialise the completion each time before using it, otherwise we end up with the possibility of returning success before the interrupt handler has processed all the data. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi_s3c24xx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index e75103aac790..6f2c79da984d 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -192,8 +192,11 @@ static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
192 hw->len = t->len; 192 hw->len = t->len;
193 hw->count = 0; 193 hw->count = 0;
194 194
195 init_completion(&hw->done);
196
195 /* send the first byte */ 197 /* send the first byte */
196 writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT); 198 writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
199
197 wait_for_completion(&hw->done); 200 wait_for_completion(&hw->done);
198 201
199 return hw->count; 202 return hw->count;