Skip to contentSkip to conversation

spi: micro: fix unreasonable clk_prepare_enable() on error in mchp_corespi_probe()

PATCH In review Peng Wu 3 participants 3 messages Jun 11, 2022 – Jun 13, 2022

Subsystems (2)
lore
Share & tools
lore

Peng Wu

author
#0 lore raw

PATCH 1/1 spi: micro: fix unreasonable clk_prepare_enable() on error in mchp_corespi_probe()

Fix the unreasonable clk_prepare_enable() with clk_disable_unprepare() before return from mchp_corespi_probe() in the error handling case.

---
 drivers/spi/spi-microchip-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-microchip-core.c +1 -1
index 5b2aee30fa04..bf6847d95fe3 100644
@@ -580,7 +580,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 
 error_release_hardware:
 	mchp_corespi_disable(spi);
-	clk_prepare_enable(spi->clk);
+	clk_disable_unprepare(spi->clk);
 error_release_master:
 	spi_master_put(master);
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Peng Wu

spi: micro: fix unreasonable clk_prepare_enable() on error in mchp_corespi_probe()

^ s/micro/microchip-core ?

Quoted 7 lines

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Fix the unreasonable clk_prepare_enable() with clk_disable_unprepare() before return from mchp_corespi_probe() in the error handling case.

"unreasonable", very diplomatic way of putting it!

Good spot, thanks.

Quoted 20 lines
---
 drivers/spi/spi-microchip-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-microchip-core.c +1 -2
index 5b2aee30fa04..bf6847d95fe3 100644
@@ -580,7 +580,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 
 error_release_hardware:
        mchp_corespi_disable(spi);
-       clk_prepare_enable(spi->clk);
+       clk_disable_unprepare(spi->clk);
 error_release_master:
        spi_master_put(master);
 
--

2.17.1

maintainer
#2 lore raw
In reply to Peng Wu
Quoted 4 lines · Peng Wu

Fix the unreasonable clk_prepare_enable() with clk_disable_unprepare() before return from mchp_corespi_probe() in the error handling case.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: micro: fix unreasonable clk_prepare_enable() on error in mchp_corespi_probe()

      commit: 116679aef2f92d535ea8049ef2a610bc73f94660

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv