summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-09-27 11:33:19 +0100
committerMark Brown <broonie@kernel.org>2022-09-27 11:33:19 +0100
commitdd1b25ec8b2072dfe58325e13785f0dfef94b2c3 (patch)
tree83d857dd1c315065dc6c5bfd0c8211778f86b2ab /drivers/spi
parentfc13b5a25e18b0de5e04b6f5616c60d71d2610ee (diff)
parent29f65f2171c85a9633daa380df14009a365f42f2 (diff)
downloadlinux-stable-dd1b25ec8b2072dfe58325e13785f0dfef94b2c3.tar.gz
linux-stable-dd1b25ec8b2072dfe58325e13785f0dfef94b2c3.tar.bz2
linux-stable-dd1b25ec8b2072dfe58325e13785f0dfef94b2c3.zip
Fix PM disable depth imbalance in probe
Merge series from Zhang Qilong <zhangqilong3@huawei.com>: The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed when error returns to keep it balanced. This series of patches fixed it in spi probe.
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-cadence-quadspi.c3
-rw-r--r--drivers/spi/spi-dw-bt1.c4
-rw-r--r--drivers/spi/spi-omap-100k.c1
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 72b1a5a2298c..106c09ffa425 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1619,7 +1619,7 @@ static int cqspi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
ret = pm_runtime_resume_and_get(dev);
if (ret < 0)
- return ret;
+ goto probe_pm_failed;
ret = clk_prepare_enable(cqspi->clk);
if (ret) {
@@ -1712,6 +1712,7 @@ probe_reset_failed:
clk_disable_unprepare(cqspi->clk);
probe_clk_failed:
pm_runtime_put_sync(dev);
+probe_pm_failed:
pm_runtime_disable(dev);
return ret;
}
diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
index c06553416123..3fb89dee595e 100644
--- a/drivers/spi/spi-dw-bt1.c
+++ b/drivers/spi/spi-dw-bt1.c
@@ -293,8 +293,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
ret = dw_spi_add_host(&pdev->dev, dws);
- if (ret)
+ if (ret) {
+ pm_runtime_disable(&pdev->dev);
goto err_disable_clk;
+ }
platform_set_drvdata(pdev, dwsbt1);
diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 20b047172965..061f7394e5b9 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -412,6 +412,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
return status;
err_fck:
+ pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(spi100k->fck);
err_ick:
clk_disable_unprepare(spi100k->ick);