Unverified Commit 612227b3 authored by Miquel Raynal (Schneider Electric)'s avatar Miquel Raynal (Schneider Electric) Committed by Mark Brown
Browse files

spi: cadence-qspi: Try hard to disable the clocks



In the remove path, we should try hard to perform all steps as we simply
cannot fail.

The "no runtime PM" quirk must only alter the state of the RPM core, but
the clocks should still be disabled if that is possible. Move the
disable call outside of the RPM quirk.

Tested-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarMiquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Tested-by: default avatarSanthosh Kumar K <s-k6@ti.com>
Link: https://patch.msgid.link/20260122-schneider-6-19-rc1-qspi-v4-9-f9c21419a3e6@bootlin.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f18c8cfa
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2038,6 +2038,7 @@ static void cqspi_remove(struct platform_device *pdev)
	const struct cqspi_driver_platdata *ddata;
	struct cqspi_st *cqspi = platform_get_drvdata(pdev);
	struct device *dev = &pdev->dev;
	int ret = 0;

	ddata = of_device_get_match_data(dev);

@@ -2057,7 +2058,9 @@ static void cqspi_remove(struct platform_device *pdev)
		cqspi_jh7110_disable_clk(pdev, cqspi);

	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
		if (pm_runtime_get_sync(&pdev->dev) >= 0)
		ret = pm_runtime_get_sync(&pdev->dev);

	if (ret >= 0)
		clk_disable(cqspi->clk);

	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {