From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Stanimir Varbanov <stanimir.varbanov@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org
Subject: [PATCH 64/78] media: core: use pm_runtime_resume_and_get()
Date: Sat, 24 Apr 2021 08:45:14 +0200 [thread overview]
Message-ID: <1fb9919b1cb83dd6db934dab74442c981eeda7f0.1619191723.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1619191723.git.mchehab+huawei@kernel.org>
Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.
Use the new API, in order to cleanup the error check logic.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
drivers/media/platform/qcom/venus/core.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 54bac7ec14c5..c156320fa256 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -84,7 +84,7 @@ static void venus_sys_error_handler(struct work_struct *work)
container_of(work, struct venus_core, work.work);
int ret = 0;
- pm_runtime_get_sync(core->dev);
+ pm_runtime_resume_and_get(core->dev);
hfi_core_deinit(core, true);
@@ -106,7 +106,7 @@ static void venus_sys_error_handler(struct work_struct *work)
hfi_reinit(core);
- pm_runtime_get_sync(core->dev);
+ pm_runtime_resume_and_get(core->dev);
ret |= venus_boot(core);
ret |= hfi_core_resume(core, true);
@@ -305,21 +305,21 @@ static int venus_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0)
goto err_runtime_disable;
ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
if (ret)
- goto err_runtime_disable;
+ goto err_pm;
ret = venus_firmware_init(core);
if (ret)
- goto err_runtime_disable;
+ goto err_pm;
ret = venus_boot(core);
if (ret)
- goto err_runtime_disable;
+ goto err_pm;
ret = hfi_core_resume(core, true);
if (ret)
@@ -351,8 +351,9 @@ static int venus_probe(struct platform_device *pdev)
v4l2_device_unregister(&core->v4l2_dev);
err_venus_shutdown:
venus_shutdown(core);
-err_runtime_disable:
+err_pm:
pm_runtime_put_noidle(dev);
+err_runtime_disable:
pm_runtime_set_suspended(dev);
pm_runtime_disable(dev);
hfi_destroy(core);
@@ -371,7 +372,7 @@ static int venus_remove(struct platform_device *pdev)
struct device *dev = core->dev;
int ret;
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
WARN_ON(ret < 0);
ret = hfi_core_deinit(core, true);
@@ -403,7 +404,7 @@ static void venus_core_shutdown(struct platform_device *pdev)
{
struct venus_core *core = platform_get_drvdata(pdev);
- pm_runtime_get_sync(core->dev);
+ pm_runtime_resume_and_get(core->dev);
venus_shutdown(core);
venus_firmware_deinit(core);
pm_runtime_put_sync(core->dev);
--
2.30.2
next prev parent reply other threads:[~2021-04-24 6:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-24 6:44 [PATCH 00/78] media: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Mauro Carvalho Chehab
2021-04-24 6:45 ` [PATCH 60/78] media: camss-csid: use pm_runtime_resume_and_get() Mauro Carvalho Chehab
2021-04-24 6:45 ` [PATCH 61/78] media: camss-csiphy: " Mauro Carvalho Chehab
2021-04-24 6:45 ` [PATCH 62/78] media: camss-ispif: " Mauro Carvalho Chehab
2021-04-24 6:45 ` [PATCH 63/78] media: camss-vfe: " Mauro Carvalho Chehab
2021-04-24 6:45 ` Mauro Carvalho Chehab [this message]
2021-04-24 6:45 ` [PATCH 65/78] media: pm_helpers: " Mauro Carvalho Chehab
2021-04-24 6:45 ` [PATCH 66/78] media: vdec: " Mauro Carvalho Chehab
2021-04-24 6:45 ` [PATCH 67/78] media: venc: " Mauro Carvalho Chehab
2021-04-28 10:13 ` [PATCH 00/78] media: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Dan Carpenter
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=1fb9919b1cb83dd6db934dab74442c981eeda7f0.1619191723.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab@kernel.org \
--cc=stanimir.varbanov@linaro.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;
as well as URLs for NNTP newsgroup(s).