All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Qilong <zhangqilong3@huawei.com>
To: <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>
Subject: [PATCH -next 2/3] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
Date: Sat, 24 Sep 2022 20:13:08 +0800	[thread overview]
Message-ID: <20220924121310.78331-3-zhangqilong3@huawei.com> (raw)
In-Reply-To: <20220924121310.78331-1-zhangqilong3@huawei.com>

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:abf00907538e2 ("spi: dw: Add Baikal-T1 SPI Controller glue driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/spi/spi-dw-bt1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
 
-- 
2.25.1


  parent reply	other threads:[~2022-09-24 12:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24 12:13 [PATCH -next 0/3] Fix PM disable depth imbalance in probe Zhang Qilong
2022-09-24 12:13 ` [PATCH -next 1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Zhang Qilong
2022-09-24 12:13 ` Zhang Qilong [this message]
2022-09-24 12:13 ` [PATCH -next 3/3] spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe Zhang Qilong
2022-09-27 10:34 ` [PATCH -next 0/3] Fix PM disable depth imbalance in probe Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220924121310.78331-3-zhangqilong3@huawei.com \
    --to=zhangqilong3@huawei.com \
    --cc=broonie@kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.