Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Markus Elfring and committed by
Mark Brown
610442f8 003c7e01

+1 -3
+1 -3
drivers/spi/spi-slave-mt27xx.c
··· 455 455 pm_runtime_enable(&pdev->dev); 456 456 457 457 ret = devm_spi_register_controller(&pdev->dev, ctlr); 458 + clk_disable_unprepare(mdata->spi_clk); 458 459 if (ret) { 459 460 dev_err(&pdev->dev, 460 461 "failed to register slave controller(%d)\n", ret); 461 - clk_disable_unprepare(mdata->spi_clk); 462 462 goto err_disable_runtime_pm; 463 463 } 464 - 465 - clk_disable_unprepare(mdata->spi_clk); 466 464 467 465 return 0; 468 466