From: Dongliang Mu <mudongliangabcd@gmail.com>
To: Jean-Christophe Trotin <jean-christophe.trotin@foss.st.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Dongliang Mu <mudongliangabcd@gmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] driver: hva: add pm_runtime_disable in the error handling code of hva_hw_probe
Date: Tue, 19 Oct 2021 11:00:29 +0800 [thread overview]
Message-ID: <20211019030030.3326236-1-mudongliangabcd@gmail.com> (raw)
In the error handling code of hva_hw_probe, it fails to invoke
pm_runtime_disable in many error sites.
Fix this by adding a label err_disable with pm_runtime_disable and
adjust one goto from label err_clk to err_disable.
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
drivers/media/platform/sti/hva/hva-hw.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/sti/hva/hva-hw.c b/drivers/media/platform/sti/hva/hva-hw.c
index 30fb1aa4a351..5dd5dbf59cfe 100644
--- a/drivers/media/platform/sti/hva/hva-hw.c
+++ b/drivers/media/platform/sti/hva/hva-hw.c
@@ -387,7 +387,7 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "%s failed to set PM\n", HVA_PREFIX);
- goto err_clk;
+ goto err_disable;
}
/* check IP hardware version */
@@ -405,6 +405,8 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
err_pm:
pm_runtime_put(dev);
+err_disable:
+ pm_runtime_disable(dev);
err_clk:
if (hva->clk)
clk_unprepare(hva->clk);
--
2.25.1
reply other threads:[~2021-10-19 3:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20211019030030.3326236-1-mudongliangabcd@gmail.com \
--to=mudongliangabcd@gmail.com \
--cc=jean-christophe.trotin@foss.st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®