Skip to content

Commit f148915

Browse files
krzkbroonie
authored andcommitted
spi: spi-fsl-dspi: Initialize completion before possible interrupt
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3d87b61 commit f148915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,15 +1389,15 @@ static int dspi_probe(struct platform_device *pdev)
13891389
goto poll_mode;
13901390
}
13911391

1392+
init_completion(&dspi->xfer_done);
1393+
13921394
ret = request_threaded_irq(dspi->irq, dspi_interrupt, NULL,
13931395
IRQF_SHARED, pdev->name, dspi);
13941396
if (ret < 0) {
13951397
dev_err(&pdev->dev, "Unable to attach DSPI interrupt\n");
13961398
goto out_clk_put;
13971399
}
13981400

1399-
init_completion(&dspi->xfer_done);
1400-
14011401
poll_mode:
14021402

14031403
if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) {

0 commit comments

Comments
 (0)