diff options
author | Clark Wang <xiaoning.wang@nxp.com> | 2022-04-06 10:46:24 +0800 |
---|---|---|
committer | Clark Wang <xiaoning.wang@nxp.com> | 2022-04-11 09:56:19 +0800 |
commit | 6f51f5e8bf69618c3121458e9d0e7c81b1a35fcf (patch) | |
tree | f636c21679e7cd17aab3f781ec6a2be769772f2d /drivers/spi | |
parent | 18eb84bcc4ed6de5f2ec02becc5bc76648e7a79c (diff) |
LF-5804 spi: lpspi: add DMA roll-back path
If spi_register_controller return a defer probe error, no DMA roll-back
operation can remove the DMA configurations. When probe SPI in the
second time, fsl_lpspi_dma_init will return error.
So add a DMA roll-back path here.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-fsl-lpspi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 25b1e1d92fc8..4ebfd4433590 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -926,7 +926,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev) ret = devm_spi_register_controller(&pdev->dev, controller); if (ret < 0) { dev_err(&pdev->dev, "spi_register_controller error.\n"); - goto out_pm_get; + goto out_dma_init; } pm_runtime_mark_last_busy(fsl_lpspi->dev); @@ -934,6 +934,8 @@ static int fsl_lpspi_probe(struct platform_device *pdev) return 0; +out_dma_init: + fsl_lpspi_dma_exit(controller); out_pm_get: pm_runtime_dont_use_autosuspend(fsl_lpspi->dev); pm_runtime_put_sync(fsl_lpspi->dev); |