未验证 提交 45f0bbda 编写于 作者: M Marek Vasut 提交者: Mark Brown

spi: imx: Fix freeing of DMA channels if spi_bitbang_start() fails

If the SPI controller has has_dmamode = true and spi_bitbang_start() fails
in spi_imx_probe(), then the driver must release the DMA channels acquired
in spi_imx_sdma_init() by calling spi_imx_sdma_exit() in the fail path.

Fixes: f62caccd ("spi: spi-imx: add DMA support")
Signed-off-by: NMarek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Robin Gong <b38343@freescale.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Link: https://lore.kernel.org/r/20201005132229.513119-1-marex@denx.deSigned-off-by: NMark Brown <broonie@kernel.org>
上级 1c33524f
......@@ -1707,7 +1707,7 @@ static int spi_imx_probe(struct platform_device *pdev)
ret = spi_bitbang_start(&spi_imx->bitbang);
if (ret) {
dev_err(&pdev->dev, "bitbang start failed with %d\n", ret);
goto out_runtime_pm_put;
goto out_bitbang_start;
}
dev_info(&pdev->dev, "probed\n");
......@@ -1717,6 +1717,9 @@ static int spi_imx_probe(struct platform_device *pdev)
return ret;
out_bitbang_start:
if (spi_imx->devtype_data->has_dmamode)
spi_imx_sdma_exit(spi_imx);
out_runtime_pm_put:
pm_runtime_dont_use_autosuspend(spi_imx->dev);
pm_runtime_put_sync(spi_imx->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册