1
0
Fork 0

MLK-24366-1 spi: lpspi: add the missing pm_runtime_put in probe

Add the missing calling of the pm_runtime_put_xxx() to ensure pm_runtime
functions use in pairs.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Clark Wang 2020-07-02 15:38:59 +08:00
parent 0e631625a9
commit 81050978c0
1 changed files with 9 additions and 1 deletions

View File

@ -971,13 +971,21 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
ret = fsl_lpspi_dma_init(&pdev->dev, fsl_lpspi, controller);
if (ret == -EPROBE_DEFER)
goto out_controller_put;
goto err_disable_runtime_pm;
if (ret < 0)
dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret);
pm_runtime_mark_last_busy(fsl_lpspi->dev);
pm_runtime_put_autosuspend(fsl_lpspi->dev);
return 0;
err_disable_runtime_pm:
pm_runtime_dont_use_autosuspend(fsl_lpspi->dev);
pm_runtime_put_sync(fsl_lpspi->dev);
pm_runtime_disable(fsl_lpspi->dev);
out_controller_put:
spi_controller_put(controller);