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

From: Peng Wu
Date: Fri Jun 10 2022 - 22:16:57 EST


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

Signed-off-by: Peng Wu <wupeng58@xxxxxxxxxx>
---
drivers/spi/spi-microchip-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 5b2aee30fa04..bf6847d95fe3 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -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