[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e736d33-b07f-40a0-8fb6-8c3212593b77@web.de>
Date: Tue, 24 Sep 2024 20:56:08 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-spi@...r.kernel.org,
Angelo Gioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Leilk Liu <leilk.liu@...iatek.com>, Mark Brown <broonie@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: [PATCH] spi: slave-mt27xx: Call clk_disable_unprepare() only once in
mtk_spi_slave_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 24 Sep 2024 20:47:29 +0200
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@...rs.sourceforge.net>
---
drivers/spi/spi-slave-mt27xx.c | 4 +---
1 file changed, 1 insertion(+), 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:
--
2.46.1
Powered by blists - more mailing lists