Skip to content

Commit 2abbae5

Browse files
wangxiaoningnxpbroonie
authored andcommitted
spi: lpspi: fix the imbalance of runtime pm function call
Call the put function after probe successfully. Otherwise, the lpspi module will keep active status until the first spi transfer called. Disable runtime pm when probe fails. There is no need to active runtime pm after probe failed. Signed-off-by: Clark Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2b2d441 commit 2abbae5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/spi/spi-fsl-lpspi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,10 +913,15 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
913913
if (ret < 0)
914914
dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret);
915915

916+
pm_runtime_mark_last_busy(fsl_lpspi->dev);
917+
pm_runtime_put_autosuspend(fsl_lpspi->dev);
918+
916919
return 0;
917920

918921
out_pm_get:
919-
pm_runtime_put_noidle(fsl_lpspi->dev);
922+
pm_runtime_dont_use_autosuspend(fsl_lpspi->dev);
923+
pm_runtime_put_sync(fsl_lpspi->dev);
924+
pm_runtime_disable(fsl_lpspi->dev);
920925
out_controller_put:
921926
spi_controller_put(controller);
922927

0 commit comments

Comments
 (0)