diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2024-09-24 20:47:29 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-09-30 01:12:23 +0200 |
commit | 610442f85c12ff662e3dec50c53d92f7a8e5a783 (patch) | |
tree | 64fb0b1e0e4adac0049e5e1f9f84b157279e3155 /drivers/spi | |
parent | 003c7e01916c5e2af95add9b0cbda2e6163873e8 (diff) |
spi: slave-mt27xx: Call clk_disable_unprepare() only once in mtk_spi_slave_probe()
A clk_disable_unprepare(mdata->spi_clk) call was immediately used
after a return value check for a devm_spi_register_controller() call
in this function implementation.
Thus call such a function only once instead directly before the check.
This issue was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: https://patch.msgid.link/9e736d33-b07f-40a0-8fb6-8c3212593b77@web.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-slave-mt27xx.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c index 4a91b7bae3c6..40e1e7de0742 100644 --- a/drivers/spi/spi-slave-mt27xx.c +++ b/drivers/spi/spi-slave-mt27xx.c @@ -455,15 +455,13 @@ static int mtk_spi_slave_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = devm_spi_register_controller(&pdev->dev, ctlr); + clk_disable_unprepare(mdata->spi_clk); if (ret) { dev_err(&pdev->dev, "failed to register slave controller(%d)\n", ret); - clk_disable_unprepare(mdata->spi_clk); goto err_disable_runtime_pm; } - clk_disable_unprepare(mdata->spi_clk); - return 0; err_disable_runtime_pm: |