Skip to content

Commit

Permalink
spi: spi-fsl-dspi: Initialize completion before possible interrupt
Browse files Browse the repository at this point in the history
The interrupt handler calls completion and is IRQ requested before the
completion is initialized.  Logically it should be the other way.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200622110543.5035-4-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Jun 22, 2020
1 parent 3d87b61 commit f148915
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-fsl-dspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,15 +1389,15 @@ static int dspi_probe(struct platform_device *pdev)
goto poll_mode;
}

init_completion(&dspi->xfer_done);

ret = request_threaded_irq(dspi->irq, dspi_interrupt, NULL,
IRQF_SHARED, pdev->name, dspi);
if (ret < 0) {
dev_err(&pdev->dev, "Unable to attach DSPI interrupt\n");
goto out_clk_put;
}

init_completion(&dspi->xfer_done);

poll_mode:

if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) {
Expand Down

0 comments on commit f148915

Please sign in to comment.