diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-08 22:06:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-10 07:32:16 -0500 |
commit | aa0fe82629f19efba5c870bc9be089a4f8056a75 (patch) | |
tree | d0d0ea5fb465f35f8fe335914dfbeb23d53c1cb8 | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
spi: Use reinit_completion at appropriate places
Calling init_completion() once is enough.
For the rest of the iterations, call reinit_completion() instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-bcm63xx-hsspi.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-efm32.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-imx.c | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index b528f9fc8bc0..3ad3e0c59992 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c | |||
@@ -180,7 +180,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t) | |||
180 | while (pending > 0) { | 180 | while (pending > 0) { |
181 | int curr_step = min_t(int, step_size, pending); | 181 | int curr_step = min_t(int, step_size, pending); |
182 | 182 | ||
183 | init_completion(&bs->done); | 183 | reinit_completion(&bs->done); |
184 | if (tx) { | 184 | if (tx) { |
185 | memcpy_toio(bs->fifo + HSSPI_OPCODE_LEN, tx, curr_step); | 185 | memcpy_toio(bs->fifo + HSSPI_OPCODE_LEN, tx, curr_step); |
186 | tx += curr_step; | 186 | tx += curr_step; |
@@ -369,6 +369,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) | |||
369 | bs->fifo = (u8 __iomem *)(bs->regs + HSSPI_FIFO_REG(0)); | 369 | bs->fifo = (u8 __iomem *)(bs->regs + HSSPI_FIFO_REG(0)); |
370 | 370 | ||
371 | mutex_init(&bs->bus_mutex); | 371 | mutex_init(&bs->bus_mutex); |
372 | init_completion(&bs->done); | ||
372 | 373 | ||
373 | master->bus_num = HSSPI_BUS_NUM; | 374 | master->bus_num = HSSPI_BUS_NUM; |
374 | master->num_chipselect = 8; | 375 | master->num_chipselect = 8; |
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 77286aef2adf..161c7910a818 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -169,7 +169,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first, | |||
169 | transfer_list); | 169 | transfer_list); |
170 | } | 170 | } |
171 | 171 | ||
172 | init_completion(&bs->done); | 172 | reinit_completion(&bs->done); |
173 | 173 | ||
174 | /* Fill in the Message control register */ | 174 | /* Fill in the Message control register */ |
175 | msg_ctl = (len << SPI_BYTE_CNT_SHIFT); | 175 | msg_ctl = (len << SPI_BYTE_CNT_SHIFT); |
@@ -353,6 +353,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) | |||
353 | } | 353 | } |
354 | 354 | ||
355 | bs = spi_master_get_devdata(master); | 355 | bs = spi_master_get_devdata(master); |
356 | init_completion(&bs->done); | ||
356 | 357 | ||
357 | platform_set_drvdata(pdev, master); | 358 | platform_set_drvdata(pdev, master); |
358 | bs->pdev = pdev; | 359 | bs->pdev = pdev; |
diff --git a/drivers/spi/spi-efm32.c b/drivers/spi/spi-efm32.c index d4d3cc534792..03cbb5eb33d6 100644 --- a/drivers/spi/spi-efm32.c +++ b/drivers/spi/spi-efm32.c | |||
@@ -198,7 +198,7 @@ static int efm32_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
198 | 198 | ||
199 | efm32_spi_filltx(ddata); | 199 | efm32_spi_filltx(ddata); |
200 | 200 | ||
201 | init_completion(&ddata->done); | 201 | reinit_completion(&ddata->done); |
202 | 202 | ||
203 | efm32_spi_write32(ddata, REG_IF_TXBL | REG_IF_RXDATAV, REG_IEN); | 203 | efm32_spi_write32(ddata, REG_IF_TXBL | REG_IF_RXDATAV, REG_IEN); |
204 | 204 | ||
@@ -349,6 +349,7 @@ static int efm32_spi_probe(struct platform_device *pdev) | |||
349 | ddata->bitbang.txrx_bufs = efm32_spi_txrx_bufs; | 349 | ddata->bitbang.txrx_bufs = efm32_spi_txrx_bufs; |
350 | 350 | ||
351 | spin_lock_init(&ddata->lock); | 351 | spin_lock_init(&ddata->lock); |
352 | init_completion(&ddata->done); | ||
352 | 353 | ||
353 | ddata->clk = devm_clk_get(&pdev->dev, NULL); | 354 | ddata->clk = devm_clk_get(&pdev->dev, NULL); |
354 | if (IS_ERR(ddata->clk)) { | 355 | if (IS_ERR(ddata->clk)) { |
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index a5474ef9d2a0..6bb0b693c98c 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c | |||
@@ -741,7 +741,7 @@ static int spi_imx_transfer(struct spi_device *spi, | |||
741 | spi_imx->count = transfer->len; | 741 | spi_imx->count = transfer->len; |
742 | spi_imx->txfifo = 0; | 742 | spi_imx->txfifo = 0; |
743 | 743 | ||
744 | init_completion(&spi_imx->xfer_done); | 744 | reinit_completion(&spi_imx->xfer_done); |
745 | 745 | ||
746 | spi_imx_push(spi_imx); | 746 | spi_imx_push(spi_imx); |
747 | 747 | ||