Commit aa0fe826 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 38dbfb59
...@@ -180,7 +180,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t) ...@@ -180,7 +180,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t)
while (pending > 0) { while (pending > 0) {
int curr_step = min_t(int, step_size, pending); int curr_step = min_t(int, step_size, pending);
init_completion(&bs->done); reinit_completion(&bs->done);
if (tx) { if (tx) {
memcpy_toio(bs->fifo + HSSPI_OPCODE_LEN, tx, curr_step); memcpy_toio(bs->fifo + HSSPI_OPCODE_LEN, tx, curr_step);
tx += curr_step; tx += curr_step;
...@@ -369,6 +369,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) ...@@ -369,6 +369,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
bs->fifo = (u8 __iomem *)(bs->regs + HSSPI_FIFO_REG(0)); bs->fifo = (u8 __iomem *)(bs->regs + HSSPI_FIFO_REG(0));
mutex_init(&bs->bus_mutex); mutex_init(&bs->bus_mutex);
init_completion(&bs->done);
master->bus_num = HSSPI_BUS_NUM; master->bus_num = HSSPI_BUS_NUM;
master->num_chipselect = 8; master->num_chipselect = 8;
......
...@@ -169,7 +169,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first, ...@@ -169,7 +169,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,
transfer_list); transfer_list);
} }
init_completion(&bs->done); reinit_completion(&bs->done);
/* Fill in the Message control register */ /* Fill in the Message control register */
msg_ctl = (len << SPI_BYTE_CNT_SHIFT); msg_ctl = (len << SPI_BYTE_CNT_SHIFT);
...@@ -353,6 +353,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) ...@@ -353,6 +353,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
} }
bs = spi_master_get_devdata(master); bs = spi_master_get_devdata(master);
init_completion(&bs->done);
platform_set_drvdata(pdev, master); platform_set_drvdata(pdev, master);
bs->pdev = pdev; bs->pdev = pdev;
......
...@@ -198,7 +198,7 @@ static int efm32_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) ...@@ -198,7 +198,7 @@ static int efm32_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
efm32_spi_filltx(ddata); efm32_spi_filltx(ddata);
init_completion(&ddata->done); reinit_completion(&ddata->done);
efm32_spi_write32(ddata, REG_IF_TXBL | REG_IF_RXDATAV, REG_IEN); efm32_spi_write32(ddata, REG_IF_TXBL | REG_IF_RXDATAV, REG_IEN);
...@@ -349,6 +349,7 @@ static int efm32_spi_probe(struct platform_device *pdev) ...@@ -349,6 +349,7 @@ static int efm32_spi_probe(struct platform_device *pdev)
ddata->bitbang.txrx_bufs = efm32_spi_txrx_bufs; ddata->bitbang.txrx_bufs = efm32_spi_txrx_bufs;
spin_lock_init(&ddata->lock); spin_lock_init(&ddata->lock);
init_completion(&ddata->done);
ddata->clk = devm_clk_get(&pdev->dev, NULL); ddata->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(ddata->clk)) { if (IS_ERR(ddata->clk)) {
......
...@@ -741,7 +741,7 @@ static int spi_imx_transfer(struct spi_device *spi, ...@@ -741,7 +741,7 @@ static int spi_imx_transfer(struct spi_device *spi,
spi_imx->count = transfer->len; spi_imx->count = transfer->len;
spi_imx->txfifo = 0; spi_imx->txfifo = 0;
init_completion(&spi_imx->xfer_done); reinit_completion(&spi_imx->xfer_done);
spi_imx_push(spi_imx); spi_imx_push(spi_imx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment