Skip to content

Commit 610442f

Browse files
elfringbroonie
authored andcommitted
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>
1 parent 003c7e0 commit 610442f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/spi/spi-slave-mt27xx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,13 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
455455
pm_runtime_enable(&pdev->dev);
456456

457457
ret = devm_spi_register_controller(&pdev->dev, ctlr);
458+
clk_disable_unprepare(mdata->spi_clk);
458459
if (ret) {
459460
dev_err(&pdev->dev,
460461
"failed to register slave controller(%d)\n", ret);
461-
clk_disable_unprepare(mdata->spi_clk);
462462
goto err_disable_runtime_pm;
463463
}
464464

465-
clk_disable_unprepare(mdata->spi_clk);
466-
467465
return 0;
468466

469467
err_disable_runtime_pm:

0 commit comments

Comments
 (0)