[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210430185352.00003b27@Huawei.com>
Date: Fri, 30 Apr 2021 18:53:52 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
CC: <linuxarm@...wei.com>, <mauro.chehab@...wei.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
"Mauro Carvalho Chehab" <mchehab@...nel.org>,
Stanimir Varbanov <stanimir.varbanov@...aro.org>,
<linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-media@...r.kernel.org>
Subject: Re: [PATCH v4 67/79] media: venus: vdec: use
pm_runtime_resume_and_get()
On Wed, 28 Apr 2021 16:52:28 +0200
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> wrote:
> 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@...nel.org>
> ---
> drivers/media/platform/qcom/venus/vdec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index ddb7cd39424e..347e533ea673 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -568,7 +568,7 @@ static int vdec_pm_get(struct venus_inst *inst)
> int ret;
>
> mutex_lock(&core->pm_lock);
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> mutex_unlock(&core->pm_lock);
>
> return ret < 0 ? ret : 0;
Don't need this dance any more due to " Return 0 if the runtime PM usage counter of @dev has been
* incremented or a negative error code otherwise."
return ret;
> @@ -601,7 +601,7 @@ static int vdec_pm_get_put(struct venus_inst *inst)
> mutex_lock(&core->pm_lock);
>
> if (pm_runtime_suspended(dev)) {
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> if (ret < 0)
> goto error;
>
Powered by blists - more mailing lists