Skip to content

Commit 612227b

Browse files
miquelraynalbroonie
authored andcommitted
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com> Tested-by: Santhosh 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: Mark Brown <broonie@kernel.org>
1 parent f18c8cf commit 612227b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/spi/spi-cadence-quadspi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,7 @@ static void cqspi_remove(struct platform_device *pdev)
20382038
const struct cqspi_driver_platdata *ddata;
20392039
struct cqspi_st *cqspi = platform_get_drvdata(pdev);
20402040
struct device *dev = &pdev->dev;
2041+
int ret = 0;
20412042

20422043
ddata = of_device_get_match_data(dev);
20432044

@@ -2057,8 +2058,10 @@ static void cqspi_remove(struct platform_device *pdev)
20572058
cqspi_jh7110_disable_clk(pdev, cqspi);
20582059

20592060
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
2060-
if (pm_runtime_get_sync(&pdev->dev) >= 0)
2061-
clk_disable(cqspi->clk);
2061+
ret = pm_runtime_get_sync(&pdev->dev);
2062+
2063+
if (ret >= 0)
2064+
clk_disable(cqspi->clk);
20622065

20632066
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
20642067
pm_runtime_put_sync(&pdev->dev);

0 commit comments

Comments
 (0)