linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()
@ 2023-11-29  8:11 Yang Yingliang
  2023-12-04 15:47 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2023-11-29  8:11 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, william.qiu, hal.feng, yangyingliang

cqspi_jh7110_clk_init() is called after clk_prepare_enable(cqspi->clk),
if it fails, it should goto label 'probe_reset_failed' to disable
cqspi->clk.

In the error path after calling cqspi_jh7110_clk_init(),
cqspi_jh7110_disable_clk() need be called.

Fixes: 33f1ef6d4eb6 ("spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPI")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/spi/spi-cadence-quadspi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 3d7bf62da11c..f94e0d370d46 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1840,7 +1840,7 @@ static int cqspi_probe(struct platform_device *pdev)
 		if (ddata->jh7110_clk_init) {
 			ret = cqspi_jh7110_clk_init(pdev, cqspi);
 			if (ret)
-				goto probe_clk_failed;
+				goto probe_reset_failed;
 		}
 
 		if (of_device_is_compatible(pdev->dev.of_node,
@@ -1901,6 +1901,8 @@ static int cqspi_probe(struct platform_device *pdev)
 probe_setup_failed:
 	cqspi_controller_enable(cqspi, 0);
 probe_reset_failed:
+	if (cqspi->is_jh7110)
+		cqspi_jh7110_disable_clk(pdev, cqspi);
 	clk_disable_unprepare(cqspi->clk);
 probe_clk_failed:
 	return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()
  2023-11-29  8:11 [PATCH] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe() Yang Yingliang
@ 2023-12-04 15:47 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-12-04 15:47 UTC (permalink / raw)
  To: linux-spi, Yang Yingliang; +Cc: william.qiu, hal.feng

On Wed, 29 Nov 2023 16:11:47 +0800, Yang Yingliang wrote:
> cqspi_jh7110_clk_init() is called after clk_prepare_enable(cqspi->clk),
> if it fails, it should goto label 'probe_reset_failed' to disable
> cqspi->clk.
> 
> In the error path after calling cqspi_jh7110_clk_init(),
> cqspi_jh7110_disable_clk() need be called.
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()
      commit: 5cb475174cce1bfedf1025b6e235e2c43d81144f

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-04 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29  8:11 [PATCH] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe() Yang Yingliang
2023-12-04 15:47 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).