From: Alexander Stein <[email protected]>

commit f02bff30114f385d53ae3e45141db602923bca5d from upstream.

The requested DMA channels are never released. Do this in .remove as well
as in .probe. spi_register_controller() can return -EPROBE_DEFER if
cs-gpios are not probed yet.

Signed-off-by: Alexander Stein <[email protected]>
Link: 
https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Xiaolei Wang <[email protected]>
---
 drivers/spi/spi-fsl-lpspi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 1ac7b2940b54..96d58cb7b7ec 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -922,7 +922,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 free_dma;
        }
 
        pm_runtime_mark_last_busy(fsl_lpspi->dev);
@@ -930,6 +930,8 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
 
        return 0;
 
+free_dma:
+       fsl_lpspi_dma_exit(controller);
 out_pm_get:
        pm_runtime_dont_use_autosuspend(fsl_lpspi->dev);
        pm_runtime_put_sync(fsl_lpspi->dev);
@@ -946,6 +948,8 @@ static int fsl_lpspi_remove(struct platform_device *pdev)
        struct fsl_lpspi_data *fsl_lpspi =
                                spi_controller_get_devdata(controller);
 
+       fsl_lpspi_dma_exit(controller);
+
        pm_runtime_disable(fsl_lpspi->dev);
        return 0;
 }
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11104): 
https://lists.yoctoproject.org/g/linux-yocto/message/11104
Mute This Topic: https://lists.yoctoproject.org/mt/90146165/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to