Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context.

Fixes:73d5fe0462702 ("spi: cadence-quadspi: Remove spi_master_put() in probe failure path")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220924121310.78331-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Zhang Qilong and committed by
Mark Brown
4d0ef0a1 a6bfc42f

+2 -1
+2 -1
drivers/spi/spi-cadence-quadspi.c
··· 1619 1619 pm_runtime_enable(dev); 1620 1620 ret = pm_runtime_resume_and_get(dev); 1621 1621 if (ret < 0) 1622 - return ret; 1622 + goto probe_pm_failed; 1623 1623 1624 1624 ret = clk_prepare_enable(cqspi->clk); 1625 1625 if (ret) { ··· 1712 1712 clk_disable_unprepare(cqspi->clk); 1713 1713 probe_clk_failed: 1714 1714 pm_runtime_put_sync(dev); 1715 + probe_pm_failed: 1715 1716 pm_runtime_disable(dev); 1716 1717 return ret; 1717 1718 }